Skip to content

Commit c91e8e0

Browse files
committed
chore: add tsdown
1 parent a9dcfc1 commit c91e8e0

File tree

8 files changed

+514
-311
lines changed

8 files changed

+514
-311
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,9 @@
156156
"stylelint-order": "^6.0.4",
157157
"ts-jest": "^29.1.2",
158158
"ts-node": "^10.9.1",
159-
"typescript": "~5.4.5",
159+
"tsdown": "^0.12.1",
160160
"tslib": "^2.6.2",
161+
"typescript": "~5.4.5",
161162
"vitest": "^1.6.0"
162163
},
163164
"pnpm": {

packages/taro-rn/src/lib/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// 由 getLibList.js 脚本生成, 不要进行手动修改, 请不要手动修改
2-
export * from './ENV_TYPE'
32
export * from './arrayBufferToBase64'
43
export * from './authorize'
54
export * from './base64ToArrayBuffer'
@@ -16,6 +15,7 @@ export * from './createInnerAudioContext'
1615
export * from './createSelectorQuery'
1716
export * from './createVideoContext'
1817
export * from './downloadFile'
18+
export * from './ENV_TYPE'
1919
export * from './getAppBaseInfo'
2020
export * from './getClipboardData'
2121
export * from './getEnv'

packages/taro-runtime/jest.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
const path = require('path')
1+
import path from 'node:path'
2+
import { fileURLToPath } from 'node:url'
23

3-
module.exports = {
4+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
5+
6+
export default {
47
globals: {
58
ENABLE_INNER_HTML: true,
69
ENABLE_ADJACENT_HTML: true,

packages/taro-runtime/package.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "@tarojs/runtime",
3+
"type": "module",
34
"version": "4.1.1",
45
"description": "taro runtime for mini apps.",
56
"author": "O2Team",
@@ -16,12 +17,9 @@
1617
"./dist/dom-external/index.js"
1718
],
1819
"scripts": {
19-
"prod": "pnpm run build",
20-
"prebuild": "pnpm run clean",
21-
"build": "pnpm run rollup --environment NODE_ENV:production",
22-
"clean": "rimraf ./dist",
23-
"dev": "pnpm run rollup --environment NODE_ENV:development -w",
24-
"rollup": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
20+
"prod": "tsdown",
21+
"build": "tsdown",
22+
"dev": "tsdown -w",
2523
"test": "jest",
2624
"test:ci": "jest --ci -i --coverage --silent"
2725
},
@@ -37,12 +35,9 @@
3735
"tslib": "^2.6.2"
3836
},
3937
"devDependencies": {
40-
"@rollup/plugin-typescript": "^12.1.2",
4138
"@types/react": "^18.2.79",
4239
"@vue/runtime-core": "^3.4.23",
4340
"lodash": "^4.17.21",
44-
"react": "^18.2.0",
45-
"rollup": "^4.37.0",
46-
"rollup-plugin-ts": "^3.4.5"
41+
"react": "^18.2.0"
4742
}
4843
}

packages/taro-runtime/rollup.config.ts

Lines changed: 0 additions & 48 deletions
This file was deleted.

packages/taro-runtime/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"outDir": "./dist",
88
"target": "ES2017"
99
},
10-
"include": ["./src", "./rollup.config.ts"],
10+
"include": ["./src"],
1111
"exclude": ["./src/__tests__"]
1212
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { defineConfig } from 'tsdown'
2+
3+
export default [
4+
defineConfig({
5+
entry: 'src/**/*.ts',
6+
treeshake: false,
7+
sourcemap: true,
8+
platform: 'neutral'
9+
}),
10+
defineConfig({
11+
entry: {
12+
'runtime.esm': 'src/index.ts',
13+
},
14+
treeshake: false,
15+
sourcemap: true,
16+
platform: 'neutral'
17+
})
18+
]

0 commit comments

Comments
 (0)