Skip to content

Commit a05f740

Browse files
committed
Fix SyntaxError: Cannot use import statement outside a module
(create dist without the use of import)
1 parent 1d0ed5d commit a05f740

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

.babelrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

.babelrc.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const { NODE_ENV } = process.env;
2+
3+
const presets = [
4+
"@babel/preset-env",
5+
"@babel/preset-react",
6+
];
7+
const plugins = [
8+
"@babel/plugin-proposal-object-rest-spread",
9+
"@babel/plugin-proposal-class-properties",
10+
"@babel/plugin-transform-react-jsx"
11+
12+
];
13+
14+
if (NODE_ENV === "production") {
15+
plugins.push("transform-react-remove-prop-types");
16+
}
17+
18+
module.exports = { presets, plugins };

0 commit comments

Comments
 (0)