Skip to content

Commit db88a15

Browse files
authored
chore!: switch to tsup (#2391)
1 parent 44d698e commit db88a15

File tree

7 files changed

+369
-374
lines changed

7 files changed

+369
-374
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This is a shorthand for running the following scripts in order:
2020

2121
## Good to know
2222

23-
- The project is being built by [esbuild](https://esbuild.github.io) (see [bundle.ts](scripts/bundle.ts))
23+
- The project is being built by [tsup](https://tsup.egoist.dev) (see [tsup.config.ts](tsup.config.ts))
2424
- The documentation is running via VitePress.
2525
Make sure you **build** the project before running the docs, cause some files depend on `dist`.
2626
Use `pnpm run docs:dev` to edit them in live mode.
@@ -49,7 +49,7 @@ Please only change files related to one module (e.g. person, location) whenever
4949

5050
## Building Faker
5151

52-
The project is being built by [esbuild](https://esbuild.github.io) (see [bundle.ts](scripts/bundle.ts))
52+
The project is being built by [tsup](https://tsup.egoist.dev) (see [tsup.config.ts](tsup.config.ts))
5353

5454
```shell
5555
pnpm install

docs/guide/upgrading_v9/2391.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Using tsup for the build process
2+
3+
We only support exports defined via `package.json` but after the switch to `tsup`, there are now complete restructures in the dist folder resulting it minified and chunked files for cjs.

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
],
2929
"bugs": "https://github.com/faker-js/faker/issues",
3030
"license": "MIT",
31-
"main": "dist/cjs/index.js",
32-
"module": "dist/esm/index.mjs",
31+
"main": "dist/index.js",
32+
"module": "dist/index.mjs",
3333
"types": "index.d.ts",
3434
"typesVersions": {
3535
">=4.0": {
@@ -41,13 +41,13 @@
4141
"exports": {
4242
".": {
4343
"types": "./dist/types/index.d.ts",
44-
"require": "./dist/cjs/index.js",
45-
"import": "./dist/esm/index.mjs"
44+
"require": "./dist/index.js",
45+
"import": "./dist/index.mjs"
4646
},
4747
"./locale/*": {
4848
"types": "./dist/types/locale/*.d.ts",
49-
"require": "./dist/cjs/locale/*.js",
50-
"import": "./dist/esm/locale/*.mjs"
49+
"require": "./dist/locale/*.js",
50+
"import": "./dist/locale/*.mjs"
5151
},
5252
"./package.json": "./package.json"
5353
},
@@ -58,7 +58,7 @@
5858
"scripts": {
5959
"clean": "rimraf coverage .eslintcache dist docs/.vitepress/dist locale pnpm-lock.yaml node_modules",
6060
"build:clean": "rimraf dist",
61-
"build:code": "tsx ./scripts/bundle.ts",
61+
"build:code": "tsup-node",
6262
"build:types": "tsc --project tsconfig.build.json",
6363
"build": "run-s build:clean build:code build:types",
6464
"generate": "run-s generate:locales generate:api-docs",
@@ -106,7 +106,6 @@
106106
"@vueuse/core": "~10.7.2",
107107
"conventional-changelog-cli": "~4.1.0",
108108
"cypress": "~13.6.4",
109-
"esbuild": "~0.20.0",
110109
"eslint": "~8.56.0",
111110
"eslint-config-prettier": "~9.1.0",
112111
"eslint-define-config": "~2.1.0",
@@ -124,6 +123,7 @@
124123
"sanitize-html": "~2.11.0",
125124
"semver": "~7.6.0",
126125
"standard-version": "~9.5.0",
126+
"tsup": "~8.0.2",
127127
"tsx": "~4.7.1",
128128
"typedoc": "~0.25.7",
129129
"typescript": "~5.3.3",

0 commit comments

Comments
 (0)