Issue with babel 7
See original GitHub issueWhen we define a config file like that :
{
"plugins": [["transform-define", "./config/config.js"]]
}
We get the following error with babel 7 :
.plugins[1][1] must be an object, false, or undefined
Issue Analytics
- State:
- Created 6 years ago
- Reactions:22
- Comments:14
Top Results From Across the Web
Upgrade to Babel 7
Babel has had issues previously with handling node_modules , symlinks, and monorepos. We've made some changes to account for this: Babel will stop...
Read more >Issues · babel/babel - GitHub
Babel is a compiler for writing next generation JavaScript. - Issues · babel/babel. ... #15157 opened on Nov 7, 2022 by aaronadamsCA.
Read more >Why is Babel 7 not compiling node_modules files?
This new behaviour is really stupid. It means dependencies can no longer tell their parent projects how to transpile them, which encourages library...
Read more >babel-loader - npm
This package allows transpiling JavaScript files using Babel and webpack. Note: Issues with the output should be reported on the Babel ...
Read more >React Ecosystem: Setting up Babel 7 and Webpack 5 for React
"@babel/plugin-proposal-throw-expressions": "7.12.13", }. To avoid any braking issue due to version change in the future, I have locked the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, guys.
I managed how to fix that passing an object config to this plugin using .babelrc.js instead of .babelrc:
What about something like that : https://github.com/Vincz/babel-plugin-transform-define/commit/5ba90a6ad8ba8fc4fa9b791d80409db0b1c3ab3d
Or maybe
__file
instead offile
We cannot use a string as plugin configuration anymore. So we have to use an object even for the file import feature and we need to know if the user want to have an object as config or if he wants to use a config file.
I used to use it like that in my .babelrc :