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

Bundle standalone using rollup #10779

Merged

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Nov 29, 2019

Q                       A
Fixed Issues? Shrink *-standalone size
Tests Added + Pass? Nope
Documentation PR Link
Any Dependency Changes? Rollup plugins are added, webpack plugins/gulp-uglify are removed.
License MIT

This PR supersedes #7581 and is loosely based on #7581 because I find it too difficult to rebase.

This PR translates the webpack config in the language of rollup config. gulp-uglify is also replaced by rollup-plugin-terser.

Updates:
There is a fatal error on the previous size comparison table, some of the dependencies of babel-preset-env-standalone was not bundled due to the importer is not an ES Module. The new size comparison has reflected on this fix. Thanks to @nicolo-ribaudo who fist discovered this error.

Here is the size comparison between Circle CI Artifacts and *-standalone 7.7.4 (babel, env)

Previous Size New Size Change
babel.js 3.04 MB 2.6 MB -14%
babel.min.js 1.63 MB 1.2 MB -26%
babel-preset-env.js 2.93 MB 3.3 MB +13%
babel-preset-env.min.js 1.7 MB 1.3 MB -24%

The increased size in babel-preset-env.js is from the fact that rollup does not strip the comments by default. For production usage, please refer to babel-preset-env.min.js.

Here is the size comparison between [Circle CI Artifacts](https://app.circleci.com/jobs/github/babel/babel/13068) and `*-standalone` 7.7.4 ([babel](https://unpkg.com/browse/@babel/standalone@7.7.4/), [env](https://unpkg.com/browse/@babel/preset-env-standalone@7.7.4/))
Previous Size New Size Change
babel.js 3.04 MB 2.6 MB 14%
babel.min.js 1.63 MB 1.2 MB 26%
babel-preset-env.js 2.93 MB 1.0 MB 66%
babel-preset-env.min.js 1.7 MB 450 kB 74%

(It seems that buildsize does not comment for unknown reasons...)

@JLHwung JLHwung added the PR: Internal 🏠 A type of pull request used for our changelog categories label Nov 29, 2019
@JLHwung JLHwung force-pushed the standalone-rollup-bundle-without-yarn-workspaces branch from 4e47930 to 5ba0487 Compare November 29, 2019 19:52
],
sourceType: "unambiguous",
},
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are removed since rollup-plugin-babel can combine the helpers into a single block.

babel.config.js Outdated Show resolved Hide resolved
@nicolo-ribaudo
Copy link
Member

CircleCI is failing because of core-js 3.4.6. It's fixed in 3.4.7, but I don't know how to clear the cache before triggering a build.

@JLHwung JLHwung force-pushed the standalone-rollup-bundle-without-yarn-workspaces branch from eedddce to 5244a7b Compare December 2, 2019 21:34
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Mar 6, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: standalone PR: Internal 🏠 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants