diff --git a/generators/application/index.ts b/generators/application/index.ts index 1c502af..3826984 100644 --- a/generators/application/index.ts +++ b/generators/application/index.ts @@ -70,16 +70,23 @@ export = class extends HtmlGenerator { }); this.fs.copy(this.templatePath("web.config"), this.destinationPath("web.config")); this.fs.copy(this.templatePath("manifest.json"), this.destinationPath("manifest.json")); + this.fs.copy(this.templatePath("config.json"), this.destinationPath("config.json")); this.fs.copyTpl(this.templatePath("index.html"), this.destinationPath("index.html"), {isExtendingMes: this.basePackage === WebAppName.MES}); } install() { + // Install the web after all files are generated + this.spawnCommandSync('gulp', ['purge']); + this.spawnCommandSync('gulp', ['install']); + // Try to populate settings const configPath = this.destinationPath("node_modules", this.basePackage, "config.setup.json"); // Add here other files that may have settings if (this.fs.exists(configPath)) { // Try to assign dynamic bundles location (optional task) try { + // delete file to recreate it from the base package + fs.unlinkSync(this.destinationPath("config.json")); // Copy config setup file fs.copyFileSync(configPath, this.destinationPath("config.json")); // Regular expression to find the bundle path within non standard config JSON @@ -136,16 +143,9 @@ export = class extends HtmlGenerator { catch (error) { this.fs.copy(this.templatePath("config.json"), this.destinationPath("config.json")); } - } else { - this.fs.copy(this.templatePath("config.json"), this.destinationPath("config.json")); } this.log(`Please configure the file ${this.destinationPath("config.json")}`); } - end() { - // Install the web after all files are generated - this.spawnCommandSync('gulp', ['purge']); - this.spawnCommandSync('gulp', ['install']); - } } diff --git a/generators/application/templates/package.json b/generators/application/templates/package.json index b521409..e264808 100644 --- a/generators/application/templates/package.json +++ b/generators/application/templates/package.json @@ -4,8 +4,9 @@ "description": "<%= package %> package", "dependencies": { <% if (basePackage && channel) { %> - "<%= basePackage %>": "<%= channel %>" + "<%= basePackage %>": "<%= channel %>", <% } %> + "lodash": "3.10.1" }, "optionalDependencies": {}, "cmfLinkDependencies" : {}