-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
babel-plugin-codegenversion: 3.0.0nodeversion: 10.15.0npm(oryarn) version: yarn 1.13.0babel: 7.4.5babel-plugin-macros: 2.5.1 (required by another dep)
Relevant code or config
// my.js
codegen`module.exports = ''`;
// babel.config.js
module.exports = {
presets: [
[
'@babel/env',
{
targets: {
browsers: [
'last 2 versions',
'ie 11',
]
},
useBuiltIns: 'usage',
corejs: 2,
},
],
],
plugins: [
'macros',
'codegen',
'@babel/plugin-syntax-dynamic-import',
],
};What you did:
Try to compile my.js
What happened:
codegen: Must module.exports a string.
at getReplacement (node_modules/babel-plugin-codegen/dist/helpers.js:43:11)
at replace (node_modules/babel-plugin-codegen/dist/helpers.js:69:21)
at asFunction (node_modules/babel-plugin-codegen/dist/replace.js:57:5)
at asIdentifier (node_modules/babel-plugin-codegen/dist/replace.js:127:22)
at PluginPass.Identifier (node_modules/babel-plugin-codegen/dist/index.js:37:11)
at newFn (node_modules/@babel/traverse/lib/visitors.js:193:21)
at NodePath._call (node_modules/@babel/traverse/lib/path/context.js:53:20)
at NodePath.call (node_modules/@babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (node_modules/@babel/traverse/lib/path/context.js:88:12)
at TraversalContext.visitQueue (node_modules/@babel/traverse/lib/context.js:118:16)
Reproduction repository:
Problem description:
I cannot seem to get past the Must module.exports a string. I've tried using escaped backticks, double quotes and single quotes, joining arrays, concatenating strings some other way (e.g., with + operator), etc.
What am I doing wrong?
Suggested solution:
n/a
fonov and FranckFreiburger
Metadata
Metadata
Assignees
Labels
No labels