-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
babel-plugin-codegenversion: 4.1.4nodeversion: v12.15.0npmversion: 6.14.11
With these files:
index.js
// @codegen
module.exports = `console.log("hello world!")`;babel.config.js
module.exports = {
presets: ['@babel/preset-typescript'],
plugins: ['codegen'],
};I ran this command:
babel --plugins codegen index.js
and got this result:
Error: [BABEL] unknown: Configuration contains string/RegExp pattern, but no filename was passed to Babel
at matchPattern (/home/jallan/dev/codegen/node_modules/@babel/core/lib/config/config-chain.js:431:11)
at /home/jallan/dev/codegen/node_modules/@babel/core/lib/config/config-chain.js:418:35
at Array.some (<anonymous>)
at matchesPatterns (/home/jallan/dev/codegen/node_modules/@babel/core/lib/config/config-chain.js:418:19)
at configFieldIsApplicable (/home/jallan/dev/codegen/node_modules/@babel/core/lib/config/config-chain.js:400:10)
at configIsApplicable (/home/jallan/dev/codegen/node_modules/@babel/core/lib/config/config-chain.js:395:41)
at /home/jallan/dev/codegen/node_modules/@babel/core/lib/config/config-chain.js:256:13
at Array.forEach (<anonymous>)
at /home/jallan/dev/codegen/node_modules/@babel/core/lib/config/config-chain.js:253:42
at buildPresetChain (/home/jallan/dev/codegen/node_modules/@babel/core/lib/config/config-chain.js:45:17)
Reproduction repository:
https://github.com/jackgeek/codegen-babel-plugin-problem
Problem description:
When using a babel.config.js file the above error occurs, however works fine if you change it to a .babelrc file. Also when you remove the typescript preset it works fine.
Metadata
Metadata
Assignees
Labels
No labels