Skip to content

Commit fbefff7

Browse files
committed
esm-with-tsup-that-supports-cjs
1 parent 418fdfd commit fbefff7

6 files changed

Lines changed: 289 additions & 299 deletions

File tree

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
"bugs": "https://github.com/faker-js/faker/issues",
3030
"license": "MIT",
3131
"type": "module",
32-
"main": "dist/cjs/index.js",
33-
"module": "dist/esm/index.js",
32+
"main": "dist/index.cjs",
33+
"module": "dist/index.js",
3434
"types": "index.d.ts",
3535
"typesVersions": {
3636
">=4.0": {
@@ -42,15 +42,15 @@
4242
"exports": {
4343
".": {
4444
"types": "./dist/types/index.d.ts",
45-
"import": "./dist/esm/index.js",
46-
"require": "./dist/cjs/index.js",
47-
"default": "./dist/esm/index.js"
45+
"import": "./dist/index.js",
46+
"require": "./dist/index.cjs",
47+
"default": "./dist/index.js"
4848
},
4949
"./locale/*": {
5050
"types": "./dist/types/locale/*.d.ts",
51-
"import": "./dist/esm/locale/*.js",
52-
"require": "./dist/cjs/locale/*.js",
53-
"default": "./dist/esm/locale/*.js"
51+
"import": "./dist/locale/*.js",
52+
"require": "./dist/locale/*.cjs",
53+
"default": "./dist/locale/*.js"
5454
},
5555
"./package.json": "./package.json"
5656
},
@@ -61,7 +61,7 @@
6161
"scripts": {
6262
"clean": "rimraf coverage .eslintcache dist docs/.vitepress/dist locale pnpm-lock.yaml node_modules",
6363
"build:clean": "rimraf dist",
64-
"build:code": "tsx ./scripts/bundle.ts",
64+
"build:code": "tsup-node",
6565
"build:types": "tsc --project tsconfig.build.json",
6666
"build": "run-s build:clean build:code build:types",
6767
"generate": "run-s generate:locales generate:api-docs",
@@ -104,7 +104,6 @@
104104
"@vueuse/core": "~10.4.1",
105105
"conventional-changelog-cli": "~4.1.0",
106106
"cypress": "~13.2.0",
107-
"esbuild": "~0.19.3",
108107
"eslint": "~8.49.0",
109108
"eslint-config-prettier": "~9.0.0",
110109
"eslint-define-config": "~1.23.0",
@@ -121,6 +120,7 @@
121120
"sanitize-html": "~2.11.0",
122121
"semver": "~7.5.4",
123122
"standard-version": "~9.5.0",
123+
"tsup": "~7.2.0",
124124
"tsx": "~3.12.10",
125125
"typedoc": "~0.24.8",
126126
"typescript": "~4.9.5",

0 commit comments

Comments
 (0)