Permalink
Browse files

feat(index): add the option 'nameLocalModules' for manually disabling…

… moduleId remapping
  • Loading branch information...
niieani committed Jul 28, 2016
1 parent fddd9e1 commit 2f9c89a326eafe1bdc57b406b85e7067c274838a
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/index.js
View
@@ -15,6 +15,7 @@ class AureliaWebpackPlugin {
options.root = options.root ? path.normalizeSafe(options.root) : path.dirname(module.parent.filename);
options.src = options.src ? path.normalizeSafe(options.src) : path.resolve(options.root, 'src');
options.nameExternalModules = options.nameExternalModules == undefined || options.nameExternalModules == true;
options.nameLocalModules = options.nameLocalModules == undefined || options.nameLocalModules == true;
options.resourceRegExp = options.resourceRegExp || /aurelia-loader-context/;
options.customViewLoaders = Object.assign({
'.css': ['css'],
@@ -210,10 +211,12 @@ class AureliaWebpackPlugin {
if (typeof module.resource == 'string') {
let moduleId;
if (module.resource.startsWith(options.src)) {
// paths inside SRC
let relativeToSrc = path.relative(options.src, module.resource);
moduleId = relativeToSrc;
if (options.nameLocalModules) {
if (module.resource.startsWith(options.src)) {
// paths inside SRC
let relativeToSrc = path.relative(options.src, module.resource);
moduleId = relativeToSrc;
}
}
if (options.nameExternalModules) {
if (!moduleId && typeof module.userRequest == 'string') {

0 comments on commit 2f9c89a

Please sign in to comment.