Skip to content

Commit 9a5ce28

Browse files
authored
fix: Fix ESM import in core package by adding .babelrc and babel-plugin-add-import-extension (#732)
1 parent fe8e356 commit 9a5ce28

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

core/.babelrc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"env": {
3+
"cjs": {
4+
"presets": [
5+
"@babel/preset-typescript"
6+
]
7+
},
8+
"esm": {
9+
"presets": [
10+
"@babel/preset-env"
11+
],
12+
"plugins": [
13+
[
14+
"babel-plugin-add-import-extension",
15+
{
16+
"extension": "js"
17+
}
18+
]
19+
]
20+
}
21+
}
22+
}

core/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,8 @@
6565
"lcov",
6666
"json-summary"
6767
]
68+
},
69+
"devDependencies": {
70+
"babel-plugin-add-import-extension": "^1.6.0"
6871
}
6972
}

0 commit comments

Comments
 (0)