Incorporating shims and polyfills into Webpack
So far, this has been a much cleaner implementation, but you still have the two dangling shims inside the index.html
file. You've pared down index.html
such that it is now requesting only a handful of JS files instead of each module target individually, but you can go even further and bundle all the JS files into a single file.
The challenge in this is that browser shims aren't delivered via modules; in other words, there aren't any other files that will import these to use them. They just assume their use is available. Therefore, the standard Webpack bundling won't pick up these targets and include them in the bundled file.
Note
The code, links, and a live example of this are available at http://ngcookbook.herokuapp.com/7479/.
Getting ready
You should complete the Migrating the minimum viable application to Webpack bundling recipe first, which will give you all the source files needed for this recipe.
How to do it...
There are a number of ways to...