Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added exclude node_modules to webpack.config's babel-loader. #9

Merged
merged 1 commit into from Oct 14, 2016
Merged

Added exclude node_modules to webpack.config's babel-loader. #9

merged 1 commit into from Oct 14, 2016

Conversation

rouzazari
Copy link
Contributor

The webpack update is great. Thank you for it. I want to make one recommendation, but please let me know if I'm misunderstanding, as I'm still learning:

Starting from commit 300317b you introduced webpack.config.babel.js to manage the bundling and babel-loader. I believe it's common practice to either exclude: /node_modules/ or include specific files or folders to avoid having babel-loader go through the whole node_modules folder. I believe this affects chapters 7-12.

I made the change below and noticed that it decreased the run time of gulp task main from 15 seconds to 2.5 seconds when excluding /node_modules/ in chapter 11. The resulting client-bundle.js is slightly different but seems to work just the same.

The bolded line below shows the change to 6 files (webpack.config.babel.js in chapter 7-12):

loaders: [
{
  test: /\.jsx?$/,
  loader: "babel-loader",
  exclude: [/node_modules/],
}

@verekia
Copy link
Owner

verekia commented Oct 14, 2016

Very good point, my bad! Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants