-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
refactor(legacy): build polyfill chunk #9639
refactor(legacy): build polyfill chunk #9639
Conversation
// Don't run esbuild for transpilation or minification | ||
// because we don't want to transpile code. | ||
esbuild: false, | ||
optimizeDeps: { | ||
esbuildOptions: { | ||
// If a value above 'es5' is set, esbuild injects helper functions which uses es2015 features. | ||
// This limits the input code not to include es2015+ codes. | ||
// But core-js is the only dependency which includes commonjs code | ||
// and core-js doesn't include es2015+ codes. | ||
target: 'es5' | ||
} | ||
} |
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.
Following up of the convo in #9635, I think esbuild: false
make sense since you showed that core-js is already in es5, and same for systemjs (except it's now using const
).
I don't quite understand the optimizeDeps.esbuildOptions.target
part though since optimizeDeps
is only for dev only for now, unless you're anticipating when we optimize in build too? I'd actually slightly lean to not optimize in build too then to simplify the bundling process 🤔
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.
Ah, yes, we could remove this for now.
#8660 was introduced when optimize in build was enabled by default. We'll need to add this or enable commonjs plugin when optimize in build is enabled by default.
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.
Actually thinking now, maybe it wouldn't hurt leaving it in anyways, but it's definitely something to keep in mind when we completely remove the commonjs plugin
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.
Just to play safe, I think we can merge this one in the 3.1 beta. We should start it soon anyways.
Description
This PR refactors how to skip esbuild transpilation.
This PR can be regarded as reverting #8660 + #9635 and applying a different fix.
IIUC this PR does not change the behavior.
refs #8660
refs #9635
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).