Skip to content

Commit cbb6d99

Browse files
committed
fix: ship esm & cjs correctly
1 parent 0d38dea commit cbb6d99

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,14 @@
2828
},
2929
"homepage": "https://github.com/DukeLuo/eslint-plugin-check-file",
3030
"type": "module",
31-
"main": "dist/index.js",
32-
"module": "dist/index.es.js",
31+
"main": "dist/index.cjs",
32+
"module": "dist/index.js",
33+
"exports": {
34+
".": {
35+
"require": "./dist/index.cjs",
36+
"import": "./dist/index.js"
37+
}
38+
},
3339
"files": [
3440
"dist"
3541
],

rollup.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ export default {
1010
output: [
1111
{
1212
format: 'cjs',
13-
file: 'dist/index.js',
13+
file: 'dist/index.cjs',
1414
banner:
1515
'/*! @author Huan Luo <dukeluo@outlook.com> (https://shaiwang.life) */',
1616
},
1717
{
1818
format: 'es',
19-
file: 'dist/index.es.js',
19+
file: 'dist/index.js',
2020
banner:
2121
'/*! @author Huan Luo <dukeluo@outlook.com> (https://shaiwang.life) */',
2222
},

0 commit comments

Comments
 (0)