Skip to content

Commit e22e169

Browse files
committed
feat: add Babel config for CommonJS compatibility
Add .babelrc.json to convert ES6 modules to CommonJS, resolving compatibility issues with Node.js environments that don't natively support ES6 modules.
1 parent 99faad3 commit e22e169

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.babelrc.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"modules": "commonjs"
7+
}
8+
]
9+
],
10+
"plugins": [
11+
["@babel/plugin-proposal-decorators", { "legacy": true }],
12+
"@babel/plugin-proposal-class-properties",
13+
"@babel/plugin-proposal-do-expressions",
14+
"@babel/plugin-proposal-export-default-from",
15+
"@babel/plugin-proposal-export-namespace-from",
16+
"@babel/plugin-proposal-function-bind",
17+
"@babel/plugin-proposal-function-sent",
18+
"@babel/plugin-proposal-json-strings",
19+
"@babel/plugin-proposal-logical-assignment-operators",
20+
"@babel/plugin-proposal-nullish-coalescing-operator",
21+
"@babel/plugin-proposal-numeric-separator",
22+
"@babel/plugin-proposal-optional-chaining",
23+
["@babel/plugin-proposal-pipeline-operator", { "proposal": "minimal" }],
24+
"@babel/plugin-proposal-throw-expressions",
25+
"@babel/plugin-syntax-dynamic-import",
26+
"@babel/plugin-syntax-import-meta"
27+
]
28+
}

0 commit comments

Comments
 (0)