New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic convert to esm with only default exports #2084
Conversation
before cytoscape.js 815.1K after cytoscape.js 888.0K seems like currently size increased with 2kb, but it should be fixed with rollup's scope hoisting |
Benchmarks has a lot of lint errors so I'd like to convert them later. |
@maxkfranz Thoughts? |
It looks OK from what I saw before. I just haven't had time to test and merge... I'll try to set aside some time tomorrow to try it out (and possibly merge). |
Some questions re. next steps: (1) Should we be specifying 'module' in package.json? http://2ality.com/2017/07/npm-packages-via-babel.html (2) Does Rollup support everything we're currently doing with Webpack in the webpack.config.js and the package.json? |
Re (2), we need: (a) Watch support : --watch via CLI: https://rollupjs.org/guide/en#command-line-flags (b) Inline source maps toggled on/off via config file: https://rollupjs.org/guide/en#output-sourcemap-m-sourcemap (c) A way to minify with Uglify and toggle it on/off with an env var in the config file: Not sure if this is possible. We could just pipe the output to uglify, but then Windows users can no longer build. For myself, that's not a problem but it might discourage Windows users from contributing to the lib. (d) Babel support: https://rollupjs.org/guide/en#babel (e) Making a UMD build that supports external refs to dependencies. Not sure if this is supported. (f) Bundling dependencies from npm that aren't ES modules: It looks like a plugin does this https://rollupjs.org/guide/en#npm-packages (g) Something analogous to EnvironmentPlugin from Webpack : Not sure if this exists |
|
Ref #2012
I decided to make at first basic conversion with only default exports. Also I added esm loader.