-
Notifications
You must be signed in to change notification settings - Fork 209
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 external @babel/runtime helpers #341
Conversation
aca1b4e
to
3282519
Compare
Do you know if this increases the size of the built javascript file? |
Do you mean the bundled file including the Babel helpers? It will probably depend on how things are build. If other libraries or the application itself uses I'll try to get some data on this :) |
3282519
to
dd5c27e
Compare
To get an idea of the size impact, I created a couple of different builds of the performance tests. This is using Webpack 4, I'd expect better results with Webpack 5 or Rollup.
Conclusion: CJS sucks but no impact on externalising these helpers :) |
], | ||
plugins: [ | ||
babel({ | ||
babelrc: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this means that we probably want to remove the production section of the .babelrc. I can do that separately.
], | ||
plugins: [ | ||
babel({ | ||
babelrc: false, | ||
babelHelpers: 'bundled', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although don't we want to change this to runtime
instead of using the getBabelOutputPlugin method? I'll try out an alternative approach now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this slightly differently here #353 Thanks for opening this PR! |
That approach is entirely fair as well. :) The different is really one of personal preference as I don't like complicated Thanks for getting this merged! |
Fixes #302
It does complicate the rollup config quite a bit but this is needed to correctly generate both the ESM and CJS versions.