Skip to content

Commit

Permalink
chore(all): prepare release 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed May 2, 2019
1 parent 9db5541 commit f96a86a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# aurelia-webpack-plugin

[![npm Version](https://img.shields.io/npm/v/aurelia-webpack-plugin.svg)](https://www.npmjs.com/package/aurelia-webpack-plugin)
[![ZenHub](https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png)](https://zenhub.io)
[![Join the chat at https://gitter.im/aurelia/discuss](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aurelia/discuss?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

This library is part of the [Aurelia](http://www.aurelia.io/) platform and contains a Webpack plugin designed to enable proper Webpack bundling.

> To keep up to date on [Aurelia](http://www.aurelia.io/), please visit and subscribe to [the official blog](http://blog.aurelia.io/) and [our email list](http://eepurl.com/ces50j). We also invite you to [follow us on twitter](https://twitter.com/aureliaeffect). If you have questions, please [join our community on Gitter](https://gitter.im/aurelia/discuss) or use [stack overflow](http://stackoverflow.com/search?q=aurelia). Documentation can be found [in our developer hub](http://aurelia.io/hub.html). If you would like to have deeper insight into our development process, please install the [ZenHub](https://zenhub.io) Chrome or Firefox Extension and visit any of our repository's boards.
> To keep up to date on [Aurelia](http://www.aurelia.io/), please visit and subscribe to [the official blog](http://blog.aurelia.io/) and [our email list](http://eepurl.com/ces50j). We also invite you to [follow us on twitter](https://twitter.com/aureliaeffect). If you have questions, please [join our community on Gitter](https://gitter.im/aurelia/discuss) or use [stack overflow](http://stackoverflow.com/search?q=aurelia). Documentation can be found [in our developer hub](http://aurelia.io/docs).
## Installation

Expand Down
36 changes: 26 additions & 10 deletions dist/AureliaPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,32 @@ class AureliaPlugin {
addEntry(options, modules) {
let webpackEntry = options.entry;
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
// (note that JS enumerates props in the same order they were declared)
// Modifying the first one only plays nice with the common pattern
// `entry: { main, vendor }` some people use.
let ks = this.options.entry || Object.keys(webpackEntry)[0];
if (!Array.isArray(ks))
ks = [ks];
ks.forEach(k => webpackEntry[k] = entries.concat(webpackEntry[k]));
if (typeof webpackEntry === "object" && !Array.isArray(webpackEntry)) {
if (this.options.entry) {
// Add runtime only to the entries defined on this plugin
let ks = this.options.entry;
if (!Array.isArray(ks))
ks = [ks];
ks.forEach(k => {
if (webpackEntry[k] === undefined) {
throw new Error('entry key "' + k + '" is not defined in Webpack build, cannot apply runtime.');
}
webpackEntry[k] = entries.concat(webpackEntry[k]);
});
}
else {
// Add runtime to each entry
for (let k in webpackEntry) {
if (!webpackEntry.hasOwnProperty(k)) {
continue;
}
let entry = webpackEntry[k];
if (!Array.isArray(entry)) {
entry = [entry];
}
webpackEntry[k] = entries.concat(entry);
}
}
}
else
options.entry = entries.concat(webpackEntry);
Expand Down
4 changes: 4 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.0.0

Remove the runtime insertion hack from the Webpack 3 and below era, wherein only the first "entry" item had the runtime appended to it. This was originally implemented to avoid adding the runtime to the secondary "vendor" entry. Using "vendor" entry points which is no longer recommended for Webpack 4 and up.

## 3.0.0

* Promote the RC to release.
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": "3.0.0",
"version": "4.0.0",
"description": "A plugin for webpack that enables bundling Aurelia applications.",
"keywords": [
"aurelia",
Expand Down

0 comments on commit f96a86a

Please sign in to comment.