Commit Graph

7 Commits

Author SHA1 Message Date
Ben McCann
dd8d267956 Remove bundled builds (#6680) 2019-11-02 15:48:49 -04:00
Sebastian Niemann
9537548321 Adds support for ES6 modules (#6619) 2019-10-27 18:28:25 -04:00
Evert Timberg
1ac3a697f7
Add babel plugin for rollup & transform code (#6555)
* Add babel plugin for rollup & transform code
* Add .browserlistrc file & copy defaults
2019-10-27 16:28:30 -04:00
Simon Brunel
35273ee948
Optimize the npm package by removing useless files (#6105)
Explicitly target files that should be included in the npm package, making it 10x smaller by removing the docs, samples, scripts, sources, tests and other useless files.
2019-03-03 15:19:11 +01:00
Simon Brunel
55128f74c1 Move CSS in a separate file to be CSP-compliant (#6048)
In order to be compatible with any CSP, we need to prevent the automatic creation of the DOM 'style' element and offer our CSS as a separate file that can be manually loaded (`Chart.js` or `Chart.min.js`). Users can now opt-out the style injection using `Chart.platform.disableCSSInjection = true` (note that the style sheet is now injected on the first chart creation).

To prevent duplicating and maintaining the same CSS code at different places, move all these rules in `platform.dom.css` and write a minimal rollup plugin to inject that style as string in `platform.dom.js`. Additionally, this plugin extract the imported style in `./dist/Chart.js` and `./dist/Chart.min.js`.
2019-02-08 19:06:04 +01:00
Simon Brunel
e07c5d0c6c
Make moment optional from our UMD builds (#5978) 2019-01-29 17:54:22 +01:00
Simon Brunel
2a97ec21c5
Migrate from Browserify to rollup (#5904)
Browserify isn't optimal bundling Chart.js because it adds too many internal wrappers, doesn't handle external/global dependencies and doesn't provide a way to generate ESM builds. Therefore, it seems the right choice to switch to rollup, so move all the build process in `rollup.config.js` and make Gulp to execute `rollup -c`.

We also had to switch to Terser instead of UglifyJS because this last one contains a breaking bug. Note that tests now use the exact same rollup config as our builds (the minified one) to ensure that the bundling and minification steps don't break anything. Finally, replace the `gulp watch` task by `gulp build --watch` to be consistent with the other `unittest` and `docs` watching syntax.
2018-12-14 20:20:43 +01:00