0

I'm trying to understand the webpack 2 and babel-loader documentation but I'm confused by the exclude option..

Here's what I mean:

{
  test: /\.jsx?$/,
  use: 'babel-loader',
  exclude: 'node_modules',
  include: 'app'
}

Include will use that loader to process the files that match in 'app', but do I need to do this for node_modules?

THanks

user1354934
  • 8,139
  • 15
  • 50
  • 80
  • This should answer your question: http://stackoverflow.com/questions/37823764/how-include-and-exclude-works-in-webpack-loader. TL;DR: Files in node_modules are likely already transformed, so you don't want to transform them again (and thus you `exclude` them). – ajm Mar 31 '17 at 18:13
  • Possible duplicate of [How "include" and "exclude" works in webpack loader](http://stackoverflow.com/questions/37823764/how-include-and-exclude-works-in-webpack-loader) – ajm Mar 31 '17 at 18:13

0 Answers0