This code puts global variable AURELIA_WEBPACK_2_0 around the Loader detection code.
It changes absolutely nothing for current users as the variable is undefined.
It is a critical piece for the upcoming DllReferencePlugin support in our webpack build. For this to work, I absolutely need aurelia-loader-webpack to be loaded in the main bundle. But what users typically do is put aurelia-bootstrapper and all libs inside a DLL. The Loader detection code was crafted to trigger a webpack dependency on aurelia-loader-webpack and so it ends up in the DLL bundle, which does not work.
To compensate, the new webpack plugins will inject aurelia-loader-webpack themselves into the build at the correct place. This helps webpack DLL work and is simpler for the end user.
I did it this way to not break compatibility with current 1.0 webpack builds. In the future, the Webpack detection code could be completely removed as the 2.0 plugins won't use it.
@EisenbergEffect I know you're doing a release very soon, can you please merge this in?
I need it to add support for webpack DLL. The change is no-op for current users, it's small and trivial.
This code puts global variable
AURELIA_WEBPACK_2_0
around the Loader detection code. It changes absolutely nothing for current users as the variable is undefined.It is a critical piece for the upcoming
DllReferencePlugin
support in our webpack build. For this to work, I absolutely needaurelia-loader-webpack
to be loaded in the main bundle. But what users typically do is putaurelia-bootstrapper
and all libs inside a DLL. The Loader detection code was crafted to trigger a webpack dependency onaurelia-loader-webpack
and so it ends up in the DLL bundle, which does not work.To compensate, the new webpack plugins will inject
aurelia-loader-webpack
themselves into the build at the correct place. This helps webpack DLL work and is simpler for the end user.I did it this way to not break compatibility with current 1.0 webpack builds. In the future, the Webpack detection code could be completely removed as the 2.0 plugins won't use it.