I am using Parcel version 2 to build my JavaScript app, and one of the modules in node_modules is CommonJS but uses "let" and "const" keywords, so I need to transpile it so it is compatible with IE 11, which we are still supporting for a few more months.
By default parceljs does not transpile code in node_modules, somehow expecting that package developers will know which browsers their users are targeting and provide ready-to-use code. I have read that parcel 2 is honors babel configuration files, and I have created one, but that alone does not tell it to transpile the code from node_modules. I do not need to transpile all the node_modules code, but apparently just the one module. Here is my .babelrc.json, which it seems to be looking at because I get some warnings about the use of parcel-env which I build:
{
"presets": [
["@babel/preset-env", {
"targets": "IE 11, last 2 versions"
}]
]
}
What other configuration am I missing to get to transpile either all of node_modules or a particular module?
Note: Other posts I have found around this topic were for version 1 of Parcel, and there were hints that there would be better options in version 2.