Skip to content

Commit af39c7a

Browse files
committed
simplify structure
1 parent 56e3467 commit af39c7a

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

packages/config/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
22
createJestTSConfig: require('./jest/config').createJestTSConfig,
33
lintStagedConfig: require('./lint-staged/config'),
4+
tsupConfig: require('./tsup/config'),
45
}

packages/config/src/tsup/config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const { defineConfig } = require('tsup')
2+
3+
module.exports = defineConfig({
4+
entry: ['src/index.ts'],
5+
format: ['esm', 'cjs'],
6+
dts: {
7+
resolve: true,
8+
entry: 'src/index.ts',
9+
},
10+
outDir: 'dist',
11+
clean: true,
12+
})

packages/page-tools/package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"directory": "packages/page-tools"
88
},
99
"license": "MIT",
10-
"module": "./dist/esm/index.mjs",
11-
"types": "./dist/cjs/index.d.ts",
12-
"main": "./dist/cjs/index.js",
10+
"module": "./dist/index.mjs",
11+
"types": "./dist/index.d.ts",
12+
"main": "./dist/index.js",
1313
"sideEffects": false,
1414
"files": [
1515
"LICENSE",
@@ -20,9 +20,7 @@
2020
"!*.tsbuildinfo"
2121
],
2222
"scripts": {
23-
"build": "rm -rf dist && yarn concurrently 'yarn:build:*'",
24-
"build:esm": "yarn tsup src/index.ts --format esm --dts --out-dir dist/esm",
25-
"build:cjs": "yarn tsup src/index.ts --format cjs --dts --out-dir dist/cjs",
23+
"build": "yarn tsup --config tsup.config.js",
2624
"lint": "yarn concurrently 'yarn:eslint .' 'yarn:tsc --noEmit'",
2725
"tsup": "yarn run -T tsup",
2826
"test": "yarn jest",

packages/page-tools/tsup.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@internal/config').tsupConfig

0 commit comments

Comments
 (0)