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

Replace webpack with Rollup #29

Merged
merged 1 commit into from
Aug 22, 2017
Merged

Replace webpack with Rollup #29

merged 1 commit into from
Aug 22, 2017

Conversation

vlad-zhukov
Copy link
Contributor

This is an initial work on #27

Features:

  • Rollup generates flat bundles that are smaller than webpack ones (going to be even smaller after converting all files to use ES modules)
  • added a new bundle with ES modules (Rollup and webpack 2+ are able to tree-shake it, but not good enough, see the reason above)
  • added "modules" and "browser" fields to package.json

Bundle sizes:
Webpack:
index.js 29621
webVersion.js 12834

Rollup:
index.js 21922
index.esm.js 20547
webVersion.js 12195

"test": "jest",
"docs": "docsify init ./docs",
"lint": "node files/lint",
"dev": "jest __tests__/tap",
"node-build": "webpack --config files/webpack.config.node.js",
"browser-build": "webpack --config files/webpack.config.js",
"all-build": "rollup -c files/rollup.config.js",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not happy with the name "all-build", do you have something better in mind?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is also an option to move it into "build" and drop npm-run-all dep

format: 'cjs',
exports: 'named',
interop: false,
sourceMap: false,
Copy link
Contributor Author

@vlad-zhukov vlad-zhukov Aug 20, 2017

Choose a reason for hiding this comment

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

I disabled source maps since they are not generated currently, but I believe they should be enabled because they provide a better development experience.

@selfrefactor selfrefactor merged commit 03ed22c into selfrefactor:master Aug 22, 2017
@vlad-zhukov vlad-zhukov deleted the rollup branch August 23, 2017 13:17
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.

2 participants