diff --git a/npm/packs/aspnetcore.mvc.ui/gulp/copy-resources.js b/npm/packs/aspnetcore.mvc.ui/gulp/copy-resources.js index dbedeeaa8e..381e6c32b5 100644 --- a/npm/packs/aspnetcore.mvc.ui/gulp/copy-resources.js +++ b/npm/packs/aspnetcore.mvc.ui/gulp/copy-resources.js @@ -13,7 +13,7 @@ function init(rootPath) { var investigatedPackagePaths = {}; - var resourceMapping = buildResourceMapping(rootPath); + var resourceMapping = normalizeResourceMapping(buildResourceMapping(rootPath)); function replaceAliases(text) { if (!resourceMapping.aliases) { @@ -51,6 +51,31 @@ } } } + + function normalizeResourceMapping(resourcemapping) { + var defaultSettings = { + aliases: { + "@node_modules": "./node_modules", + "@libs": "./wwwroot/libs" + }, + clean: [ + "@libs" + ] + }; + + extendObject(defaultSettings.aliases, resourcemapping.aliases); + resourcemapping.aliases = defaultSettings.aliases; + + if (!resourcemapping.clean) { + resourcemapping.clean = []; + } + + for (var i = 0; i < defaultSettings.clean.length; ++i) { + resourcemapping.clean.push(defaultSettings.clean[i]); + } + + return resourcemapping; + } function buildResourceMapping(packagePath) { if (investigatedPackagePaths[packagePath]) { diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Web/abp.resourcemapping.js b/templates/mvc/src/MyCompanyName.MyProjectName.Web/abp.resourcemapping.js index 77e84daf41..96f7c92778 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.Web/abp.resourcemapping.js +++ b/templates/mvc/src/MyCompanyName.MyProjectName.Web/abp.resourcemapping.js @@ -1,11 +1,7 @@ module.exports = { aliases: { - "@node_modules": "./node_modules", - "@libs": "./wwwroot/libs" + }, - clean: [ - "@libs" - ], mappings: { }