You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All ES6 codes of the color-convert module must be transpiled to ES5 through the @parcel/transformer-js module. because the IE 11 browser is specified in the browserslist property in the package.json file as you can see above.
😯 Current Behavior
The ES6 specific statements and syntax(e.g. for..of statement of color-convert, arrow function syntax of jsesc) are not being transpiled to legacy ES5. So a SyntaxError is thrown on IE 11.
💁 Possible Solution
Use [email protected] which is deprecated. Parcel v1 seems can handle the package.json#engines property of the color-convert module to make decision to execute transpilation or not. When i edit the value of the engines#node property of color-convert module to more older version like >=0.0.1 then the module is not being transpiled to ES5 by Parcel v1.
🔦 Context
I tried to use Babel but there was no effect. And I read the source code of @parcel/transformer-js, I discovered targets value is not assigned when the target asset is not a source(assets.isSource). I'm not sure, but I think Parcel v2 does not transpile modern codes in external dependencies(in node_module directory) intentionally. Is it correct?
The text was updated successfully, but these errors were encountered:
jeongtae
changed the title
Parcel does not transpile ES6+ codes in dependencies in node_modules
Parcel does not transpile ES6+ codes in node_modulesNov 14, 2021
🐛 bug report
🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
All ES6 codes of the
color-convert
module must be transpiled to ES5 through the@parcel/transformer-js
module. because theIE 11
browser is specified in thebrowserslist
property in thepackage.json
file as you can see above.😯 Current Behavior
The ES6 specific statements and syntax(e.g.
for..of
statement ofcolor-convert
, arrow function syntax ofjsesc
) are not being transpiled to legacy ES5. So a SyntaxError is thrown on IE 11.💁 Possible Solution
Use
[email protected]
which is deprecated. Parcel v1 seems can handle thepackage.json#engines
property of thecolor-convert
module to make decision to execute transpilation or not. When i edit the value of theengines#node
property ofcolor-convert
module to more older version like>=0.0.1
then the module is not being transpiled to ES5 by Parcel v1.🔦 Context
I tried to use Babel but there was no effect. And I read the source code of
@parcel/transformer-js
, I discoveredtargets
value is not assigned when the target asset is not a source(assets.isSource
). I'm not sure, but I think Parcel v2 does not transpile modern codes in external dependencies(innode_module
directory) intentionally. Is it correct?💻 Code Sample
src/index.js
node_modules/color-convert/conversions.js:10
dist/index.js:758
🌍 Your Environment
The text was updated successfully, but these errors were encountered: