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

Fix file-loader compat issue in webpacker 5 #2668

Merged
merged 1 commit into from
Aug 8, 2020

Conversation

amoshydra
Copy link
Contributor

Change file-loader esModule option to false

Resolve #2613

@gauravtiwari gauravtiwari merged commit 35b6ae3 into rails:master Aug 8, 2020
@aried3r
Copy link
Contributor

aried3r commented Aug 8, 2020

@gauravtiwari
Copy link
Member

Yes, I did, thank you.

I think at the moment it's pretty much static files: https://github.com/rails/webpacker/blob/master/lib/install/config/webpacker.yml#L21 so for general usage lets make it default to false.

I believe a lot of people would run this problem but happy to look into a simple configurable solution later.

@renchap
Copy link
Contributor

renchap commented Aug 24, 2020

This is a breaking change and should have been in a major version, or at least documented in the changelog.

If you used for example require("./file.svg").default to get the path of a SVG file, this changes your path to be undefined, and images to be empty if you used it like <img src=…>

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.

esModule file-loader compat
4 participants