Skip to content
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

Use terser, enhance rollup #1602

Closed
wants to merge 5 commits into from
Closed

Use terser, enhance rollup #1602

wants to merge 5 commits into from

Conversation

kum-deepak
Copy link
Collaborator

Ref #1595

This has package.json change. So, please run npm i. Also, I was not sure if I should checkin the package lock file, so, committed that as a separate commit.

This PR starts using terser, but does some more.

I have created a rollup config which does the following:

  • UMD and corresponding minified file in dist/es6
  • Flattened ESM and corresponding minified file in dist/esf (useful for importing as modules)
  • Split ESM in dist/esm
  • Minified ESM split modules in dist/esm-min

Currently it is not integrated with grunt. To test it, run the following:

$ rm -rf dist/*; npx rollup --config

I have included b0b66a7 which is part of #1601. I wanted to verify that with this change, the ESM version does not have import * from 'd3'.

Please see the output. For me also it was first such attempt.

It is clear from the output what rollup module splitting gives. We need to decide which of these six different output formats we need to include in our distribution.

The ESM output also shows that while our code imports everything from d3, the rollup output uses named imports.

@kum-deepak kum-deepak added the ES6 label Oct 20, 2019
@kum-deepak
Copy link
Collaborator Author

Closed in favor of #1603, simpler PR with fewer more relevant commit.

@kum-deepak kum-deepak closed this Oct 20, 2019
@kum-deepak kum-deepak deleted the terser01 branch October 20, 2019 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants