Closed MoonSangJin closed 2 years ago
The problem is assumed to be caused by adding the --no-scope-hoist option to the build. --experimental-scope-hoisting in v1 works by default in v2, but I accidentally added the --no-scope-hoist option to build. By removing that option, all arrow functions are transpiled. I found this by accident, but I'm leaving a comment in case it might be helpful to others.
And unlike package.json above, I didn't use target, I used browserlists. "browserslist": ["ie 8","Chrome 26","Firefox 16","Safari 7"] This is the browserlist I used. Now it works normally in IE11,10.
๐ bug report
Parcel includes an internal file when building for IE11 (@parcel/transformer-js/src/esmodule-helpers.js), but that file is not transpiled (arrow function is not compiled)
The error is the following: SCRIPT1022: syntax error
๐ Configuration (.babelrc, package.json, cli command)
package.json
.babelrc actually nothing
cli command
๐ค Expected Behavior
I want the code for parcelHelpers below to work in IE11, not arrow functions. Bundled files cause errors in IE11 because of codes like parcelHelpers' ()=>_applyDecoratedDescriptorDefault.default .
๐ฏ Current Behavior
๐ Possible Solution
Is there a way to compile parcelHelpers arrow functions to work in IE11?
๐ฆ Context
I am developing an sdk that runs on a modern browser, ie. When using parcel-bundler, which is originally parcel v1, there was no problem using .babelrc, but the above problem occurred while migrating to v2. @babel/preset-env was also used in the original .babelrc .
This is the old babelrc file.
I already referenced #5555, but it seems to be a different situation for me.
๐ป Code Sample
Sharing is difficult for security. Is there a way to convert the arrow function of parcelHelpers?
๐ Your Environment