-
-
Notifications
You must be signed in to change notification settings - Fork 601
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
Unexpected token 'export' using webpack.config.babel.js with Webpack CLI v5 #3559
Comments
Related to webpack/webpack-cli#3559
I'll check this. |
Related to webpack/webpack-cli#3559
@snitin315 do you maybe have any idea of a workaround? 🤔 |
Try renaming your config to a .mjs extention |
Have you tried naming your config webpack.babel.config.js too? |
Same issue. None of the breaking changes seem applicable. I don't want to start mucking around with Our config name is |
Webpack cannot find the name
Hum.. this file name is not supported by Webpack 🤔 but I still tried and Webpack cannot find it:
@evenstensberg are you suggesting me random things? 🤔 🤓 |
We recently upgraded interpret to v3 in #3437.
I believe it's related. I can see this in the CHANGELOG. |
@snitin315 Do we need to make an interpret issue? I don't fully understand why this commit is making Babel not to interpret imported files 🤔 |
No, I just wanted to find out if some extentions or prefixes were changed without having to run the repro :D Sorry! |
Hey if it's still not solved just change config.js to instead of |
Sorry for delay, I think you don't undestand how a Why it works before - let's look at changelog of
So The question - why it was done by The answer is simple - for performance reasons. Previously, if you had a So again, the solution is to add the Feel free to feedback, I will peen the issue for other developers |
Is there a typo here? It goes against the rest of your comment and doesn't work. So this change means we need to make any It's quite a messy mess. I understand the meaningful benefits for some, but for us it's just a lot of work for nothing gained. |
I undestand you, but I don't see any options to disable/configure it (we will provide them if it will be possible), maybe better ask about it interpret developers, because that's just my guess (about perf) |
See webpack/webpack-cli#3559 on why base.js had to be renamed to base.babel.js.
See webpack/webpack-cli#3559 on why base.js had to be renamed to base.babel.js.
Is there a workaround I have complex configuration with many files. Also I'm managing multiple repositories 🤔 Were should I open an issue to make something "simple" happen? |
I wanted to find a workaround but I never did. I had to rename all of our files. Sorry to be the bearer of bad news. |
@yvele Hi, I recently encountered an issue because I'm trying to remove I'm finding a way to write ESM syntax for webpack.config.js without |
package.json documentation says the below
Therefore if However, as mentioned above, if the webpack build file extension is changed to |
Describe the bug
The following
webpack.config.babel.js
works with Webpack CLI v4 but fails with v5:The error:
Full repo repo: https://github.com/yvele/webpack-cli-repro-babel
What is the current behavior?
I've created a minimal bug repo repository that works fine with Webpack CLI v4 but fails with v5:
https://github.com/yvele/webpack-cli-repro-babel
To Reproduce
Steps to reproduce the behavior:
https://github.com/yvele/webpack-cli-repro-babel#build
Expected behavior
webpack.config.babel.js
should be handled by Babel all the import way down. Same behaviour than Webpack CLI v4.Screenshots
N/A
Please paste the results of
npx webpack-cli info
here, and mention other relevant informationAdditional context
I'm using Node.js v18.12.1 and the following dependencies:
The text was updated successfully, but these errors were encountered: