skip webpack if no js files

This commit is contained in:
Jonathan Rainville 2018-09-05 11:38:09 -04:00
parent c92f6f8865
commit 047286b46d
2 changed files with 13 additions and 5 deletions

View File

@ -454,6 +454,11 @@ class EmbarkController {
async.waterfall([
function initEngine(callback) {
engine.init({}, () => {
if (engine.config.embarkConfig.config.storage === false || engine.config.storageConfig.enabled === false) {
engine.logger.error(__('Storage configuration is disabled in embark.json. Please provide a storage file before uploading'));
engine.logger.info(__('You can find an example here: %s', 'https://github.com/embark-framework/embark/blob/master/templates/demo/config/storage.js'.underline));
process.exit();
}
platform = engine.config.storageConfig.upload.provider;
callback();
});

View File

@ -85,11 +85,14 @@ class Pipeline {
},
function runWebpack(next) {
self.logger.info(__(`running webpack with '${self.webpackConfigName}' config...`));
Object.keys(self.assetFiles)
.filter(key => key.match(/\.js?$/))
.forEach(key => {
self.logger.info(__("writing file") + " " + (utils.joinPath(self.buildDir, key)).bold.dim);
});
const assets = Object.keys(self.assetFiles)
.filter(key => key.match(/\.js?$/));
assets.forEach(key => {
self.logger.info(__("writing file") + " " + (utils.joinPath(self.buildDir, key)).bold.dim);
});
if (!assets || !assets.length) {
return next();
}
let built = false;
const webpackProcess = new ProcessLauncher({
modulePath: utils.joinPath(__dirname, 'webpackProcess.js'),