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
minify unexpect transform #2089
Comments
This is because |
yep! But transform it to |
The transformation of From there, you can use that to write some code that loads the file however you'd like for it to be loaded. You could do this for example, which loads the file as a string: window.require = function (what) {
return {
then: function (cb) {
return fetch(what)
.then(function (r) { return r.text() })
.then(function (text) { return { 'default': text } })
.then(cb)
},
}
} |
Dynamic imports can be polyfilled with reliance on a global function name. Perhaps the function name should be configurable in ESBuild (can't seem to find an option in the docs)? And maybe substitution should not happen in transform mode if the option is not supplied — unless |
With the upcoming release you will be able to disable this transform with Closing as fixed because there is now a way to do this. |
Describe the bug
run for this config
esbuild transform
dynamic import
torequire
.I think need to polyfill import in chrome60
like this:
to
Reproduction
https://stackblitz.com/edit/node-qfc2yz?devtoolsheight=33&file=index.js
The text was updated successfully, but these errors were encountered: