Reduce JS bundle size and add webpack bundle analyzer
- Adding
babel-preset-envremoves the need for manual import of polyfills and will pick the necessary things out ofbabel-polyfill. - Adding
webpack-bundle-analyzergenerates abuild/assets/js/webpack-report.htmlshowing an overview of every bundle. This is tremendously helpful when analyzing bundle size. - Importing
handlebars.runtimeinstead ofhandlebarsreduces the main bundle size by about a trillion KB - Removing
element-datasetdoes not do a lot with regards to bundle size, but I never understood what it was for and it doesn't seem to be missing when removed. :)
Tested in IE >= 9 and Chrome
TODO:
- Check whether this includes the necessary polyfills only, we might have to play around with the
useBuiltInsoption some more
It seems QUnit tests are failing all around… not only in this PR
I implemented this branch in current project without issues so far. By the way: very handy (and scary up to a certain point) the stats view
@orioltf, re QUnit: Netlify seems to be fine, is it possible that the tests run through in PhantomJS (during the build) and we're just screwing up the paths for the browser?
I would say so. It seems test.js gets a 404 when loading slideshow module page.
@backflip How would you see using package.json to define the browserslist? https://github.com/ai/browserslist#environments I think it would be more transparent to everyone, specially in maintenance phases.
@orioltf Tests are fixed in https://github.com/unic/estatico/pull/89
Added to new implementation