aurelia / aurelia/webpack-plugin

Does not respect DllReferencePlugin, leading to oversized bundles

Open
#109 11 comments 1 reaction 2 assignees Claimed by @jods4 View on GitHub
bug
Dominant language
TypeScript
Stars
89
Forks
33
PR merge metrics
No merged PRs in 30d

Description

**I'm submitting a bug report**

* **Library Version:**
2.0.0-rc.2

**Please tell us about your environment:**
* **Operating System:**
Windows 10

* **Node Version:**
6.10.3

* **NPM Version:**
3.10.10

* **JSPM OR Webpack AND Version**
webpack 2.5.1

* **Browser:**
all

* **Language:**
TypeScript 2.3.2

**Current behavior:**

When using `aurelia-webpack-plugin` in a Webpack setup that includes DLL references, `aurelia-webpack-plugin` disregards the DLL references and bundles its own copy of all Aurelia modules instead of taking the modules from the DLL bundle. This means the resulting bundle contains duplicate copies of the Aurelia modules and is much bigger than necessary.

REPRO:

* Use the `dotnet new aurelia` tool to create a new ASP.NET Core Aurelia application (@MeirionHughes knows how to do this - he set up the current version of that template).
* Create a production build using `webpack --config webpack.config.vendor.js --env.prod` then `webpack --env.prod`
* Notice that the Aurelia modules are included in both the `vendor.js` file (450KB) **and** the `app.js` file (343KB). This `app.js` file is massive compared with what you'd get from other frameworks - the Angular/React/Vue/etc versions are around 20-30KB, because they all work with webpack's `DllReferencePlugin`.

* **What is the expected behavior?**

Should respect `DllReferencePlugin` and therefore not duplicate the Aurelia modules.

* **What is the motivation / use case for changing the behavior?**

Producing reasonably-sized production builds, while retaining fast dev-time builds.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.