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

Exclude mjs extension from file-loader #5235

Closed
wants to merge 2 commits into from
Closed

Conversation

jgoux
Copy link

@jgoux jgoux commented Oct 2, 2018

I excluded .mjs files from file-loader.

This should fix #5234

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@jgoux jgoux changed the title Fix 5234 Exclude mjs extension from file-loader Oct 2, 2018
@Timer Timer added this to the 2.0.4 milestone Oct 2, 2018
@Timer
Copy link
Contributor

Timer commented Oct 2, 2018

Hmm, we need to think about this more because .mjs files currently aren't being processed via the same pipeline as .js, which means they're not being transformed via Babel, etc.

Is there a way to tell webpack to pretend .mjs files have the .js extension earlier up in the chain?

@Timer
Copy link
Contributor

Timer commented Oct 2, 2018

A couple things we need to be careful of:

  1. mjs can not be permitted to work under src/. This import should fail and give you the URL.
  2. mjs must be transformed via Babel.

Let's make sure we add tests for this behavior.

@Timer Timer closed this in #5258 Oct 3, 2018
@facebook facebook deleted a comment from mkoonline1 Oct 3, 2018
@facebook facebook deleted a comment from barbiekingston Oct 4, 2018
@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mjs files get imported as static files
3 participants