#305 allow to completely remove abp.resourcemapping.js from the application for simplicity.

pull/400/head
Halil ibrahim Kalkan 7 years ago
parent 6a8dbaf348
commit 3fe99ddecc

@ -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]) {

@ -1,11 +1,7 @@
module.exports = {
aliases: {
"@node_modules": "./node_modules",
"@libs": "./wwwroot/libs"
},
clean: [
"@libs"
],
mappings: {
}

Loading…
Cancel
Save