client/general: skip vendor JS on watch
This commit is contained in:
parent
e6be94d139
commit
83086fddd0
2 changed files with 12 additions and 6 deletions
|
@ -129,7 +129,7 @@ function bundleJs(config) {
|
|||
'babel-polyfill',
|
||||
];
|
||||
glob('./js/**/*.js', {}, (er, files) => {
|
||||
{
|
||||
if (!process.argv.includes('--no-vendor-js')) {
|
||||
let b = browserify();
|
||||
for (let lib of external) {
|
||||
b.require(lib);
|
||||
|
@ -138,7 +138,7 @@ function bundleJs(config) {
|
|||
b, './public/vendor.min.js', 'Bundled vendor JS', true);
|
||||
}
|
||||
|
||||
{
|
||||
if (!process.argv.includes('--no-app-js')) {
|
||||
let outputFile = fs.createWriteStream('./public/app.min.js');
|
||||
let b = browserify({debug: config.debug});
|
||||
if (config.transpile) {
|
||||
|
@ -164,7 +164,13 @@ function copyFile(source, target) {
|
|||
|
||||
const config = getConfig();
|
||||
bundleConfig(config);
|
||||
bundleHtml(config);
|
||||
bundleCss();
|
||||
bundleJs(config);
|
||||
if (!process.argv.includes('--no-html')) {
|
||||
bundleHtml(config);
|
||||
}
|
||||
if (!process.argv.includes('--no-css')) {
|
||||
bundleCss();
|
||||
}
|
||||
if (!process.argv.includes('--no-js')) {
|
||||
bundleJs(config);
|
||||
}
|
||||
copyFile('./img/favicon.png', './public/favicon.png');
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"private": true,
|
||||
"scripts": {
|
||||
"build": "node build.js",
|
||||
"watch": "watch 'npm run build' html js css img --wait=0 --ignoreDotFiles"
|
||||
"watch": "watch 'npm run build -- --no-vendor-js' html js css img --wait=0 --ignoreDotFiles"
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-polyfill": "^6.7.4",
|
||||
|
|
Loading…
Reference in a new issue