mirror of https://github.com/embarklabs/embark.git
Return early if no modified assets
This commit is contained in:
parent
5b1a226885
commit
3437f80a89
|
@ -86,20 +86,18 @@ class Pipeline {
|
|||
function shouldRunWebpack(next){
|
||||
// assuming we got here because an asset was changed, let's check our webpack config
|
||||
// to see if the changed asset requires webpack to run
|
||||
if(modifiedAssets || modifiedAssets.length) {
|
||||
const configReader = new WebpackConfigReader({webpackConfigName: self.webpackConfigName});
|
||||
return configReader.readConfig((err, config) => {
|
||||
if(err) return next(err);
|
||||
if(!(modifiedAssets && modifiedAssets.length)) return next(null, false);
|
||||
const configReader = new WebpackConfigReader({webpackConfigName: self.webpackConfigName});
|
||||
return configReader.readConfig((err, config) => {
|
||||
if(err) return next(err);
|
||||
|
||||
if (typeof config !== 'object' || config === null) {
|
||||
return next(__('bad webpack config, the resolved config was null or not an object'));
|
||||
}
|
||||
if (typeof config !== 'object' || config === null) {
|
||||
return next(__('bad webpack config, the resolved config was null or not an object'));
|
||||
}
|
||||
|
||||
const shouldRun = modifiedAssets.some(modifiedAsset => config.module.rules.some(rule => rule.test.test(modifiedAsset)));
|
||||
return next(null, !shouldRun);
|
||||
});
|
||||
}
|
||||
next(null, false);
|
||||
const shouldRun = modifiedAssets.some(modifiedAsset => config.module.rules.some(rule => rule.test.test(modifiedAsset)));
|
||||
return next(null, !shouldRun);
|
||||
});
|
||||
},
|
||||
function runWebpack(shouldNotRun, next) {
|
||||
if(shouldNotRun) return next();
|
||||
|
|
Loading…
Reference in New Issue