Skip to content

Commit

Permalink
chore(all): prepare release 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jul 29, 2016
1 parent 2f9c89a commit c9f3ae6
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 28 deletions.
2 changes: 1 addition & 1 deletion dist/build-resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ function getResourcesOfPackage() {

function fixRelativeFromPath(fromPath, realSrcPath, realParentPath, externalModule) {
var fromPathSplit = fromPath.split('/');
if (moduleNames.indexOf(fromPathSplit[0]) !== -1 || moduleNames.indexOf(path.join(fromPathSplit[0], fromPathSplit[1])) !== -1) {
if (moduleNames.indexOf(fromPathSplit[0]) !== -1 || fromPathSplit.length > 1 && moduleNames.indexOf(path.join(fromPathSplit[0], fromPathSplit[1])) !== -1) {
return fromPath;
} else {
if (fromPath.indexOf('.') == 0) {
Expand Down
62 changes: 36 additions & 26 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ var AureliaWebpackPlugin = function () {

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 = (0, _assign2.default)({
'.css': ['css'],
Expand Down Expand Up @@ -255,35 +257,43 @@ var AureliaWebpackPlugin = function () {
}

if (typeof module.resource == 'string') {
var moduleId = void 0;

if (module.resource.startsWith(options.src)) {
var relativeToSrc = path.relative(options.src, module.resource);
moduleId = relativeToSrc;
}
if (!moduleId && typeof module.userRequest == 'string') {
var matchingModuleIds = paths.filter(function (originPath) {
return contextElements[originPath].source === module.userRequest;
}).map(function (originPath) {
return path.normalize(originPath);
});
(function () {
var moduleId = void 0;

if (matchingModuleIds.length) {
matchingModuleIds.sort(function (a, b) {
return b.length - a.length;
});
moduleId = matchingModuleIds[0];
if (options.nameLocalModules) {
if (module.resource.startsWith(options.src)) {
var relativeToSrc = path.relative(options.src, module.resource);
moduleId = relativeToSrc;
}
}
if (options.nameExternalModules) {
if (!moduleId && typeof module.userRequest == 'string') {
var matchingModuleIds = paths.filter(function (originPath) {
return contextElements[originPath].source === module.userRequest;
}).map(function (originPath) {
return path.normalize(originPath);
});

if (matchingModuleIds.length) {
matchingModuleIds.sort(function (a, b) {
return b.length - a.length;
});
moduleId = matchingModuleIds[0];
}
}
if (!moduleId && typeof module.rawRequest == 'string' && module.rawRequest.indexOf('.') !== 0) {
var index = paths.indexOf(module.rawRequest);
if (index >= 0) {
moduleId = module.rawRequest;
}
}
}
}
if (!moduleId && typeof module.rawRequest == 'string' && module.rawRequest.indexOf('.') !== 0) {
var index = paths.indexOf(module.rawRequest);
if (index >= 0) {
moduleId = module.rawRequest;
if (moduleId && !modules.find(function (m) {
return m.id === moduleId;
})) {
module.id = moduleId;
}
}
if (moduleId) {
module.id = moduleId;
}
})();
}
});
});
Expand Down
17 changes: 17 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
<a name="1.0.1"></a>
## [1.0.1](https://github.com/aurelia/webpack-plugin/compare/1.0.0...v1.0.1) (2016-07-29)


### Bug Fixes

* **build-resources:** fix a regression caused by scoping support ([d7dec55](https://github.com/aurelia/webpack-plugin/commit/d7dec55))
* **index:** do not reassign moduleId when one with the same name exists already ([fddd9e1](https://github.com/aurelia/webpack-plugin/commit/fddd9e1))


### Features

* **index:** add the option 'nameLocalModules' for manually disabling moduleId remapping ([2f9c89a](https://github.com/aurelia/webpack-plugin/commit/2f9c89a))
* **index:** make naming external modules optional ([af1a745](https://github.com/aurelia/webpack-plugin/commit/af1a745))



<a name="1.0.0"></a>
# [1.0.0](https://github.com/aurelia/webpack-plugin/compare/1.0.0-beta.4.0.1...v1.0.0) (2016-07-27)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-webpack-plugin",
"version": "1.0.0",
"version": "1.0.1",
"description": "A plugin for webpack that enables bundling Aurelia applications.",
"keywords": [
"aurelia",
Expand Down

0 comments on commit c9f3ae6

Please sign in to comment.