Skip to content

Commit

Permalink
chore(all): prepare release 2.0.0-rc.2
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Apr 5, 2017
1 parent 1134c3b commit 5d68429
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 10 deletions.
7 changes: 5 additions & 2 deletions dist/AureliaDependenciesPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ class ParserPlugin {
// This covers commonjs modules, for example:
// const _aureliaPal = require("aurelia-pal");
// _aureliaPal.PLATFORM.moduleName("id");
// Or (note: no renaming supported):
// const PLATFORM = require("aurelia-pal").PLATFORM;
// PLATFORM.moduleName("id");
parser.plugin("evaluate MemberExpression", (expr) => {
if (expr.property.name === "moduleName" &&
expr.object.type === "MemberExpression" &&
expr.object.property.name === "PLATFORM") {
(expr.object.type === "MemberExpression" && expr.object.property.name === "PLATFORM" ||
expr.object.type === "Identifier" && expr.object.name === "PLATFORM")) {
return new BasicEvaluatedExpression().setIdentifier("PLATFORM.moduleName").setRange(expr.range);
}
return undefined;
Expand Down
13 changes: 9 additions & 4 deletions dist/AureliaPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class AureliaPlugin {
viewsExtensions: ".html",
}, options);
this.options.features = Object.assign({
ie: true,
svg: true,
unparser: true,
polyfills: "es2015",
Expand All @@ -60,6 +61,8 @@ class AureliaPlugin {
const defines = {
AURELIA_WEBPACK_2_0: "true"
};
if (!features.ie)
defines.FEATURE_NO_IE = "true";
if (!features.svg)
defines.FEATURE_NO_SVG = "true";
if (!features.unparser)
Expand Down Expand Up @@ -120,12 +123,14 @@ class AureliaPlugin {
if (!dllPlugin && !opts.noWebpackLoader) {
// Setup aurelia-loader-webpack as the module loader
// Note that code inside aurelia-loader-webpack performs PLATFORM.Loader = WebpackLoader;
this.addEntry(compiler.options, "aurelia-loader-webpack");
// Since this runs very early, before any other Aurelia code, we need "aurelia-polyfills"
// for older platforms (e.g. `Map` is undefined in IE 10-).
this.addEntry(compiler.options, ["aurelia-polyfills", "aurelia-loader-webpack"]);
}
if (!opts.noHtmlLoader) {
// Ensure that we trace HTML dependencies (always required because of 3rd party libs)
let module = compiler.options.module;
let rules = module.rules || (module.rules = []);
let rules = module.rules || module.loaders || (module.rules = []);
// Note that this loader will be in last place, which is important
// because it will process the file first, before any other loader.
rules.push({ test: /\.html?$/i, use: "aurelia-webpack-plugin/html-requires-loader" });
Expand Down Expand Up @@ -157,9 +162,9 @@ class AureliaPlugin {
// with aurelia-loader, while still enabling tree shaking all other exports.
new PreserveExportsPlugin_1.PreserveExportsPlugin());
}
addEntry(options, module) {
addEntry(options, modules) {
let webpackEntry = options.entry;
let entries = [module];
let entries = Array.isArray(modules) ? modules : [modules];
if (typeof webpackEntry == "object" && !Array.isArray(webpackEntry)) {
// There are multiple entries defined in the config
// Unless there was a particular configuration, we modify the first one
Expand Down
5 changes: 4 additions & 1 deletion dist/SubFolderPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ class SubFolderPlugin {
// Only look for request not starting with a dot (module names)
// and followed by a path (slash). Support @scoped/modules.
let match = /^(?!\.)((?:@[^/]+\/)?[^/]+)(\/.*)$/i.exec(request.request);
if (!match || request.context[subFolderTrial]) {
// Fix: it seems that under some error conditions `request.context` might end up being null.
// this is bad but to help users find relevant errors on the web, we don't want to crash
// so instead we just skip the request.
if (!match || !request.context || request.context[subFolderTrial]) {
cb();
return;
}
Expand Down
3 changes: 2 additions & 1 deletion dist/types/AureliaPlugin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface Options {
dist: string;
entry?: string | string[];
features: {
ie?: boolean;
svg?: boolean;
unparser?: boolean;
polyfills?: Polyfills;
Expand All @@ -23,5 +24,5 @@ export declare class AureliaPlugin {
options: Options;
constructor(options?: Partial<Options>);
apply(compiler: Webpack.Compiler): void;
addEntry(options: Webpack.Options, module: string): void;
addEntry(options: Webpack.Options, modules: string | string[]): void;
}
13 changes: 13 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 2.0.0-rc.2

### Features

* flag to opt-out of IE support
* support module.loaders

### Bug Fixes

* errors might crash SubFolderPlugin
* compat with IE < 11
* support more CommonJS import styles

## 2.0.0-rc.1

Complete re-writer for Webpack 2.2.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-webpack-plugin",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"description": "A plugin for webpack that enables bundling Aurelia applications.",
"keywords": [
"aurelia",
Expand Down Expand Up @@ -45,7 +45,7 @@
"devDependencies": {
"@types/minimatch": "^2.0.29",
"@types/node": "^7.0.1",
"typescript": "^2.2.1"
"typescript": "^2.2.1"
},
"aurelia": {
"documentation": {
Expand Down

0 comments on commit 5d68429

Please sign in to comment.