We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d27e528 commit 316a69eCopy full SHA for 316a69e
.babelrc.js
@@ -22,6 +22,7 @@ module.exports = {
22
return {
23
visitor: {
24
ImportDeclaration: function(path, state) {
25
+ if (!path.node.source) return;
26
var source = path.node.source.value;
27
if (source.match(/^\.{0,2}\//) && !source.endsWith('.es.js')) {
28
path.replaceWith(
@@ -32,6 +33,19 @@ module.exports = {
32
33
);
34
}
35
},
36
+ ExportNamedDeclaration: function(path, state) {
37
38
+ const source = path.node.source.value;
39
+ if (source.match(/^\.{0,2}\//) && !source.endsWith('.es.js')) {
40
+ path.replaceWith(
41
+ types.exportNamedDeclaration(
42
+ path.node.declaration,
43
+ path.node.specifiers,
44
+ types.stringLiteral(source + '.es.js'),
45
+ ),
46
+ );
47
+ }
48
+ },
49
50
};
51
0 commit comments