Skip to content

Commit 56d352c

Browse files
committed
feat: update build config
1 parent a304dc6 commit 56d352c

File tree

6 files changed

+30
-50
lines changed

6 files changed

+30
-50
lines changed

packages/esbuild-plugin-alias-path/package.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
"main": "dist/index.js",
2121
"typings": "dist/index.d.ts",
2222
"scripts": {
23-
"dev": "tsup src/index.ts --watch --dts --format esm --legacy-output",
24-
"build": "rm -rf dist && tsup src/index.ts --dts --format esm,cjs --legacy-output"
23+
"dev": "tsup src/index.ts --watch --dts --format esm",
24+
"build": "rm -rf dist && tsup src/index.ts --config ../../tsup.config.ts"
2525
},
2626
"exports": {
2727
".": {
28-
"import": "./dist/esm/index.js",
2928
"require": "./dist/index.js",
29+
"import": "./dist/index.mjs",
3030
"types": "./dist/index.d.ts"
3131
}
3232
},
@@ -36,11 +36,5 @@
3636
},
3737
"peerDependencies": {
3838
"esbuild": ">= 0.14.0"
39-
},
40-
"tsup": {
41-
"entry": "src/index.ts",
42-
"splitting": false,
43-
"sourcemap": false,
44-
"clean": true
4539
}
46-
}
40+
}

packages/esbuild-plugin-clean/package.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
"typings": "dist/index.d.ts",
2424
"publishConfig": {},
2525
"scripts": {
26-
"dev": "tsup src/index.ts --watch --dts --format esm --legacy-output",
27-
"build": "rm -rf dist && tsup src/index.ts --dts --format esm,cjs --legacy-output"
26+
"dev": "tsup src/index.ts --watch --dts --format esm",
27+
"build": "rm -rf dist && tsup src/index.ts --config ../../tsup.config.ts"
2828
},
2929
"exports": {
3030
".": {
31-
"import": "./dist/esm/index.js",
3231
"require": "./dist/index.js",
32+
"import": "./dist/index.mjs",
3333
"types": "./dist/index.d.ts"
3434
}
3535
},
@@ -39,11 +39,5 @@
3939
},
4040
"peerDependencies": {
4141
"esbuild": ">= 0.14.0"
42-
},
43-
"tsup": {
44-
"entry": "src/index.ts",
45-
"splitting": false,
46-
"sourcemap": false,
47-
"clean": true
4842
}
49-
}
43+
}

packages/esbuild-plugin-compress/package.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
"main": "dist/index.js",
2323
"typings": "dist/index.d.ts",
2424
"scripts": {
25-
"dev": "tsup src/index.ts --watch --dts --format esm --legacy-output",
26-
"build": "rm -rf dist && tsup src/index.ts --dts --format esm,cjs --legacy-output"
25+
"dev": "tsup src/index.ts --watch --dts --format esm",
26+
"build": "rm -rf dist && tsup src/index.ts --config ../../tsup.config.ts"
2727
},
2828
"exports": {
2929
".": {
30-
"import": "./dist/esm/index.js",
3130
"require": "./dist/index.js",
31+
"import": "./dist/index.mjs",
3232
"types": "./dist/index.d.ts"
3333
}
3434
},
@@ -40,13 +40,7 @@
4040
"peerDependencies": {
4141
"esbuild": ">= 0.14.0"
4242
},
43-
"tsup": {
44-
"entry": "src/index.ts",
45-
"splitting": false,
46-
"sourcemap": false,
47-
"clean": true
48-
},
4943
"devDependencies": {
5044
"@types/micromatch": "^4.0.2"
5145
}
52-
}
46+
}

packages/esbuild-plugin-copy/package.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
"main": "dist/index.js",
2323
"typings": "dist/index.d.ts",
2424
"scripts": {
25-
"dev": "tsup src/index.ts --watch --dts --format esm --legacy-output",
26-
"build": "rm -rf dist && tsup src/index.ts --dts --format esm,cjs --legacy-output"
25+
"dev": "tsup src/index.ts --watch --dts --format esm",
26+
"build": "rm -rf dist && tsup src/index.ts --config ../../tsup.config.ts"
2727
},
2828
"exports": {
2929
".": {
30-
"import": "./dist/esm/index.js",
3130
"require": "./dist/index.js",
31+
"import": "./dist/index.mjs",
3232
"types": "./dist/index.d.ts"
3333
}
3434
},
@@ -39,11 +39,5 @@
3939
},
4040
"peerDependencies": {
4141
"esbuild": ">= 0.14.0"
42-
},
43-
"tsup": {
44-
"entry": "src/index.ts",
45-
"splitting": false,
46-
"sourcemap": false,
47-
"clean": true
4842
}
49-
}
43+
}

packages/esbuild-plugin-node-externals/package.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
"main": "dist/index.js",
2121
"typings": "dist/index.d.ts",
2222
"scripts": {
23-
"dev": "tsup src/index.ts --watch --dts --format esm --legacy-output",
24-
"build": "rm -rf dist && tsup src/index.ts --dts --format esm,cjs --legacy-output"
23+
"dev": "tsup src/index.ts --watch --dts --format esm",
24+
"build": "rm -rf dist && tsup src/index.ts --config ../../tsup.config.ts"
2525
},
2626
"exports": {
2727
".": {
28-
"import": "./dist/esm/index.js",
2928
"require": "./dist/index.js",
29+
"import": "./dist/index.mjs",
3030
"types": "./dist/index.d.ts"
3131
}
3232
},
@@ -36,11 +36,5 @@
3636
},
3737
"peerDependencies": {
3838
"esbuild": ">= 0.14.0"
39-
},
40-
"tsup": {
41-
"entry": "src/index.ts",
42-
"splitting": false,
43-
"sourcemap": false,
44-
"clean": true
4539
}
46-
}
40+
}

tsup.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from 'tsup';
2+
3+
export default defineConfig({
4+
splitting: false,
5+
sourcemap: false,
6+
clean: true,
7+
format: ['esm', 'cjs'],
8+
legacyOutput: false,
9+
dts: true,
10+
});

0 commit comments

Comments
 (0)