Why would we exclude node_modules when using babel-loader?

In short, transpiling is an expensive process and many projects have thousands (if not hundreds of thousands) of lines of code imported in that babel would need to run over. Your node_modules should already be runnable without transpiling as said already and there are simple ways to exclude your node_modules but transpile any code that needs it. See https://github.com/babel/babel-loader/issues/171.

I have seen a lot of arguments back and forth about whether or not it should be the developer consuming the applications job of transpiling the library or the library developer’s responsibility. Most of the time transpiling is done for browser support and the library creator has no knowledge of what browsers you need to support so they end up either transpiling or not transpiling leaving it in your hands. If they transpile to ES5 you are golden, if not it is usually a simple enough task to figure out which libraries are causing issues and transpile them yourself

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)