-
Notifications
You must be signed in to change notification settings - Fork 47
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
Add support for Babel 7 #62
Comments
@matteoantoci Hey thanks for the report, I’ll try and find time to have a look :) |
that would be nice! |
Had the very same issue, we just migrated to Babel 7, @babel/plugin-transform-modules-commonjs came to rescue. Thanks alot! |
- using 'plugin-transform-modules-commonjs' as inject-loader currently doesn't work well with Babel 7 (plasticine/inject-loader#62)
Thanks tl;dr of this is that inject-loader operates on CJS modules only (at the moment anyway), so any code you want to inject needs to be compiled to CJS before inject-loader can operate on it. This should probably be documented better and/or an example for Babel 7. |
Hey' We are currently migrating to Babel 7.5.5 and Webpack 4.35.3 and we ran into some problem with some of our tests which needs As soon as I add the Compiling the same file via babel cli works without an error. It seems that the babel configuration is not used by inject loader. (the same setup works with Babel 6 with Webpack 3) I've tried to explicitly add the Is there a workaround for this for now? |
I was able to work around this issue by upgrading {
"env": {
"test": {
"presets": [
[
"@babel/preset-env",
{
"modules": "commonjs"
}
]
]
}
} |
I opened a couple PRs that should help out here: Would love it if someone could try out the ESM feature in either PR to help identify any use cases I may have missed. |
Hi there!
Just wanted to point out that
inject-loader
doesn't work properly with Babel 7.Running my tests suite I get this error whenever
inject-loader
is imported in my tests:Maybe is due to the hardcoded usage of the deprecated
babel-core
module insideinject-loader
? 🤔The text was updated successfully, but these errors were encountered: