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 rollup to build cjs&es modules #15

Merged
merged 3 commits into from
Mar 4, 2018
Merged

Use rollup to build cjs&es modules #15

merged 3 commits into from
Mar 4, 2018

Conversation

hronro
Copy link
Contributor

@hronro hronro commented Mar 4, 2018

fix #13

@levrik levrik force-pushed the esm branch 3 times, most recently from 2c6996b to eca858b Compare March 4, 2018 13:09
output = [
{
file: resolve(__dirname, './publish/dist/index.cjs.js'),
format: 'cjs'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though tree shaking works only with ES modules?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the we still need to provide a entry file for who's build tools doesn't support es module syntax(e.g. webpack1, jest or use in Node.js directly), and then people can still use the same import useage (import { A, B } from 'mdi-react') which is more convenient than import A from 'mdi-react/A';import B from 'mdi-react/B'. And people can also use babel-plugin-import make tree-shaking available even with commonjs built.

@levrik
Copy link
Owner

levrik commented Mar 4, 2018

I just published a new version under @levrik/mdi-react with the version number 3.0.0-build.1.
Could you try if it's working for you? I will publish it under the normal package if everything works fine 🙂

@hronro
Copy link
Contributor Author

hronro commented Mar 4, 2018

@levrik It works fine for me😄

This was referenced Mar 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide es module built
2 participants