vite-plugin-taro 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/README.zh.md +6 -6
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -71,7 +71,7 @@ npm run build:h5
|
|
|
71
71
|
# Preview the built H5 app
|
|
72
72
|
npm run preview:h5
|
|
73
73
|
|
|
74
|
-
# Typecheck with
|
|
74
|
+
# Typecheck with tsc
|
|
75
75
|
npm run typecheck
|
|
76
76
|
```
|
|
77
77
|
|
|
@@ -102,11 +102,11 @@ For existing apps or custom project layouts, follow the steps below to wire the
|
|
|
102
102
|
npm install -D vite-plugin-taro
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
Your app must also provide Vite 8, React 19, React DOM 19,
|
|
105
|
+
Your app must also provide Vite 8, React 19, React DOM 19, TypeScript 7, and Node/React type packages. If your app does not already have them, install the missing packages:
|
|
106
106
|
|
|
107
107
|
```sh
|
|
108
108
|
npm install react react-dom
|
|
109
|
-
npm install -D vite @
|
|
109
|
+
npm install -D vite typescript@rc @types/node @types/react @types/react-dom cross-env
|
|
110
110
|
```
|
|
111
111
|
|
|
112
112
|
You should NOT have direct dependencies on `@tarojs/*` packages anymore. Remove them if you have.
|
|
@@ -286,7 +286,7 @@ Use the same scripts generated by `create-vite-taro`:
|
|
|
286
286
|
"build:wx": "cross-env NODE_ENV=production VITE_PLUGIN_TARO_TARGET=wx vite build",
|
|
287
287
|
"build:h5": "cross-env NODE_ENV=production VITE_PLUGIN_TARO_TARGET=h5 vite build",
|
|
288
288
|
"preview:h5": "cross-env NODE_ENV=production VITE_PLUGIN_TARO_TARGET=h5 vite preview --outDir dist/h5",
|
|
289
|
-
"typecheck": "
|
|
289
|
+
"typecheck": "tsc -b"
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
```
|
|
@@ -299,7 +299,7 @@ npm run dev:h5 # Start the H5 dev server
|
|
|
299
299
|
npm run build:wx # Build dist/wx
|
|
300
300
|
npm run build:h5 # Build dist/h5
|
|
301
301
|
npm run preview:h5 # Preview dist/h5
|
|
302
|
-
npm run typecheck # Typecheck with
|
|
302
|
+
npm run typecheck # Typecheck with tsc
|
|
303
303
|
```
|
|
304
304
|
|
|
305
305
|
Open the generated `dist/wx` directory in WeChat DevTools.
|
|
@@ -485,7 +485,7 @@ Common scripts:
|
|
|
485
485
|
| --- | --- |
|
|
486
486
|
| `pnpm prepare:taro` | Regenerate the patched React 19 Taro packages from upstream npm tarballs and local patch files. |
|
|
487
487
|
| `pnpm build:plugin` | Build `packages/vite-plugin-taro` into `dist`. |
|
|
488
|
-
| `pnpm typecheck` | Typecheck the plugin and sample app with `
|
|
488
|
+
| `pnpm typecheck` | Typecheck the plugin and sample app with `tsc`. |
|
|
489
489
|
| `pnpm lint` | Run Biome checks. |
|
|
490
490
|
| `pnpm format` | Apply Biome formatting. |
|
|
491
491
|
| `pnpm dev:sample:wx` | Build the sample WeChat Mini Program in watch mode. Build the plugin first. |
|
package/README.zh.md
CHANGED
|
@@ -71,7 +71,7 @@ npm run build:h5
|
|
|
71
71
|
# 预览构建后的 H5 应用
|
|
72
72
|
npm run preview:h5
|
|
73
73
|
|
|
74
|
-
# 使用
|
|
74
|
+
# 使用 tsc 进行类型检查
|
|
75
75
|
npm run typecheck
|
|
76
76
|
```
|
|
77
77
|
|
|
@@ -102,11 +102,11 @@ import { Text, View } from 'virtual:taro/components'
|
|
|
102
102
|
npm install -D vite-plugin-taro
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
你的应用还必须提供 Vite 8、React 19、React DOM 19、TypeScript
|
|
105
|
+
你的应用还必须提供 Vite 8、React 19、React DOM 19、TypeScript 7,以及 Node/React 类型包。如果应用尚未安装它们,请安装缺失的包:
|
|
106
106
|
|
|
107
107
|
```sh
|
|
108
108
|
npm install react react-dom
|
|
109
|
-
npm install -D vite @
|
|
109
|
+
npm install -D vite typescript@rc @types/node @types/react @types/react-dom cross-env
|
|
110
110
|
```
|
|
111
111
|
|
|
112
112
|
你不应再直接依赖任何 `@tarojs/*` 包。如果已经依赖,请将它们移除。
|
|
@@ -286,7 +286,7 @@ export default function IndexPage() {
|
|
|
286
286
|
"build:wx": "cross-env NODE_ENV=production VITE_PLUGIN_TARO_TARGET=wx vite build",
|
|
287
287
|
"build:h5": "cross-env NODE_ENV=production VITE_PLUGIN_TARO_TARGET=h5 vite build",
|
|
288
288
|
"preview:h5": "cross-env NODE_ENV=production VITE_PLUGIN_TARO_TARGET=h5 vite preview --outDir dist/h5",
|
|
289
|
-
"typecheck": "
|
|
289
|
+
"typecheck": "tsc -b"
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
```
|
|
@@ -299,7 +299,7 @@ npm run dev:h5 # 启动 H5 开发服务器
|
|
|
299
299
|
npm run build:wx # 构建 dist/wx
|
|
300
300
|
npm run build:h5 # 构建 dist/h5
|
|
301
301
|
npm run preview:h5 # 预览 dist/h5
|
|
302
|
-
npm run typecheck # 使用
|
|
302
|
+
npm run typecheck # 使用 tsc 进行类型检查
|
|
303
303
|
```
|
|
304
304
|
|
|
305
305
|
在微信开发者工具中打开生成的 `dist/wx` 目录。
|
|
@@ -485,7 +485,7 @@ pnpm typecheck
|
|
|
485
485
|
| --- | --- |
|
|
486
486
|
| `pnpm prepare:taro` | 从上游 npm tarball 和本地 patch 文件重新生成打过补丁的 React 19 Taro 包。 |
|
|
487
487
|
| `pnpm build:plugin` | 将 `packages/vite-plugin-taro` 构建到 `dist`。 |
|
|
488
|
-
| `pnpm typecheck` | 使用 `
|
|
488
|
+
| `pnpm typecheck` | 使用 `tsc` 对插件和示例应用进行类型检查。 |
|
|
489
489
|
| `pnpm lint` | 运行 Biome 检查。 |
|
|
490
490
|
| `pnpm format` | 应用 Biome 格式化。 |
|
|
491
491
|
| `pnpm dev:sample:wx` | 以 watch 模式构建微信小程序示例。请先构建插件。 |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-taro",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"author": "sep2",
|
|
5
5
|
"description": "Vite 8 plugin for building one React/Taro codebase for WeChat Mini Program and H5 targets.",
|
|
6
6
|
"type": "module",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"babel-plugin-transform-taroapi": "^4.2.0",
|
|
65
65
|
"tailwindcss": "^4.3.1",
|
|
66
66
|
"weapp-tailwindcss": "^5.0.13",
|
|
67
|
-
"@tarojs/
|
|
68
|
-
"@tarojs/react": "npm:vite-plugin-taro-react@0.2.
|
|
67
|
+
"@tarojs/react": "npm:vite-plugin-taro-react@0.2.1",
|
|
68
|
+
"@tarojs/plugin-framework-react": "npm:vite-plugin-taro-plugin-framework-react@0.2.1"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"react": "^19.0.0",
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@types/babel__core": "^7.20.5",
|
|
77
77
|
"@types/node": "^26.0.0",
|
|
78
|
-
"
|
|
78
|
+
"typescript": "^7.0.1-rc",
|
|
79
79
|
"vite": "^8.0.16"
|
|
80
80
|
},
|
|
81
81
|
"scripts": {
|
|
82
|
-
"build": "node ../../scripts/sync-plugin-readme.ts && node ../../scripts/clean-directory.ts dist &&
|
|
83
|
-
"typecheck": "
|
|
82
|
+
"build": "node ../../scripts/sync-plugin-readme.ts && node ../../scripts/clean-directory.ts dist && tsc --project tsconfig.json",
|
|
83
|
+
"typecheck": "tsc --project tsconfig.json --noEmit"
|
|
84
84
|
}
|
|
85
85
|
}
|