I have(making) an Angular 12 (IE-compatible) project where a few of my dependencies in node_modules are non es5.
In my understanding tsc doesn't do anything with node_modules and just starts to evaluate from main option present in angular.json.
While looking for options on how to do that, I see a lot of suggestions using babel, I am not sure
If I should mix babel with tsc. Or I abolish
tscand just use babel through custom-webpack?From what I understand, In all the transpilations, the transpiled code goes to an Output directory, but since I have a need to transpile js in node_modules, the output for those files should just be a replacement for their originals in node_modules? how do we achieve that?
You can add specific overrides in
includein your tsconfig.But when you bundle for the client, usually you're not including dependencies as separate scripts, you're letting your bundler figure out where to put them. You didn't mention how you're bundling currently, but you still don't need Babel if you have
allowJS: true— for example, the relevant change to a Webpack config would beHowever if you want automatic polyfills,
@babel/preset-envwith a Browserslist string is likely the best option.