Skip to content

Commit 18905e8

Browse files
authored
refactor: move CommonJS entry from cjs/index.js to index.cjs (#346)
* refactor: move CommonJS entry from `cjs/index.js` to `index.cjs` * style: add new line
1 parent ec2ff0c commit 18905e8

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
node_modules
22
/.nyc_output
3-
/cjs
4-
/coverage
3+
/index.cjs
4+
/coverage

eslint.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ export default [
1414
globals: { ...globals.builtin, ...globals.node },
1515
},
1616
},
17-
{ ignores: ['cjs'] },
17+
{ ignores: ['index.cjs'] },
1818
]

package.cjs.json

-1
This file was deleted.

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@
2626
},
2727
"require": {
2828
"types": "./index.d.ts",
29-
"default": "./cjs/index.js"
29+
"default": "./index.cjs"
3030
}
3131
}
3232
},
3333
"types": "index.d.ts",
3434
"bin": "cli.js",
3535
"files": [
36-
"cjs",
3736
"index.js",
3837
"index.d.ts",
3938
"cli.js",
40-
"reporter.js"
39+
"reporter.js",
40+
"index.cjs"
4141
],
4242
"scripts": {
43-
"build": "esbuild index.js --bundle --platform=node --alias:git-hooks-list=./git-hooks-list_shim.cjs --outfile=./cjs/index.js && ncp package.cjs.json ./cjs/package.json",
43+
"build": "esbuild index.js --bundle --platform=node --alias:git-hooks-list=./git-hooks-list_shim.cjs --outfile=./index.cjs",
4444
"fix": "eslint . --fix && prettier . --write && node cli.js \"package.json\"",
4545
"lint": "eslint . && prettier . \"!**/*.js\" --check && node cli.js \"package.json\" --check",
4646
"prepare": "husky install",

0 commit comments

Comments
 (0)