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

node_modules should no longer be compiled by default #2624

Merged
merged 1 commit into from
Jun 17, 2020

Conversation

jakeNiemiec
Copy link
Member

node_modules will no longer be compiled by default. This primarily fixes rails issue #35501 as well as numerous other webpacker issues. The disabled loader can still be required explicitly via:

const nodeModules = require('@rails/webpacker/rules/node_modules.js')
environment.loaders.append('nodeModules', nodeModules)

If you have added environment.loaders.delete('nodeModules') to your environment.js, this must be removed or you will receive an error (Item nodeModules not found).

fixes rails/rails#35501
fixes #2131
fixes rails/rails#36278
fixes #2407
fixes #2114
fixes #1949
fixes #1865
fixes #1857

@jakeNiemiec jakeNiemiec changed the title node_modules is no longer compiled by default node_modules should no longer be compiled by default Jun 8, 2020
@kaspth kaspth requested a review from javan June 9, 2020 09:47
Copy link
Contributor

@javan javan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you confirmed that this fixes compiling JS for a fresh Rails 6 app (e.g. rails/rails#35501, rails/rails#36278)?

@jakeNiemiec
Copy link
Member Author

Have you confirmed that this fixes compiling JS for a fresh Rails 6 app

@javan I have tested against these 3 cases and everything seems to work well.

@modusss rails/rails#36278 (comment)
image

@terracatta rails/rails#35501 (comment)
image

@ngottlieb #2131 (comment)
image

//cc @gauravtiwari

Copy link
Contributor

@javan javan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢it

@maschwenk
Copy link
Contributor

Can/should I close? https://github.com/rails/webpacker/pull/2075/files

@gauravtiwari
Copy link
Member

Thanks @jakeNiemiec lets work out what else we need to get in the major 6.0.0 release.

@ximus
Copy link

ximus commented Jan 14, 2021

@gauravtiwari Seems like the rules/node_modules mentioned here still needs to be added, not sure what its contents should be.

It's now documented in the changelog but absent in the tree. I couldn't find an issue tracking this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment