Skip to content

Commit 67724b4

Browse files
pshrmnCompuIves
authored andcommitted
Support dynamic import in vanilla template for Babel v7 (#1931)
* Support dynamic import in vanilla template * Undo babel.6.26.js change * Don't attempt to support Babel 6
1 parent a89b95e commit 67724b4

File tree

1 file changed

+2
-1
lines changed
  • packages/common/src/templates/configuration/babelrc

1 file changed

+2
-1
lines changed

packages/common/src/templates/configuration/babelrc/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ const config: ConfigurationFile = {
111111
],
112112
'transform-object-rest-spread',
113113
];
114+
const parserOpts = isV7 ? { plugins: ['dynamicImport'] } : {};
114115

115116
const packageJSONModule = resolveModule('/package.json');
116117

@@ -137,7 +138,7 @@ const config: ConfigurationFile = {
137138
}
138139
}
139140

140-
return JSON.stringify({ presets, plugins }, null, 2);
141+
return JSON.stringify({ presets, plugins, parserOpts }, null, 2);
141142
}
142143

143144
if (template === 'cxjs') {

0 commit comments

Comments
 (0)