vite-plugin-taro 0.1.4 → 0.1.6
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.en.md +7 -6
- package/README.md +7 -6
- package/package.json +4 -4
package/README.en.md
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
# vite-plugin-taro
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/vite-plugin-taro)
|
|
4
|
+

|
|
4
5
|
[](LICENSE)
|
|
5
6
|
|
|
6
7
|
[简体中文](README.md) | English
|
|
7
8
|
|
|
8
9
|
Build WeChat Mini Apps with the latest standards-based frontend stack: Vite 8, React 19, and Tailwind CSS v4.
|
|
9
10
|
|
|
10
|
-
`vite-plugin-taro` is for applications that want Taro's cross-platform React components and APIs, but prefer Vite instead of Taro webpack.
|
|
11
|
+
`vite-plugin-taro` is for applications that want Taro's cross-platform React components and APIs, but prefer Vite instead of Taro webpack. You only need this plugin to build a complete WeChat Mini Program.
|
|
11
12
|
|
|
12
13
|
Live demo: <https://sep2.github.io/vite-plugin-taro>. See [Sample app](https://github.com/sep2/vite-plugin-taro/tree/main/packages/loan-genius/README.en.md) how to run it locally.
|
|
13
14
|
|
|
14
|
-
- **One codebase, two targets** Build WeChat Mini Program and H5 outputs from shared React/Taro pages.
|
|
15
15
|
- **Native Vite builds** Use standard Vite 8 config instead of legacy webpack configuration, with support for all Vite plugins.
|
|
16
16
|
- **Hot reload** Both WeChat Mini Program and H5 support dev-mode watch, with Vite 8 HMR/rebuilds for fast feedback.
|
|
17
17
|
- **Battle-tested Taro foundation** Use the full set of Taro APIs and components instead of reinventing cross-platform primitives.
|
|
18
18
|
- **Tailwind ready** Built-in Tailwind CSS v4 support for both WeChat Mini Program and H5 styles.
|
|
19
|
-
- **Conditional compilation** Use Taro-style `#ifdef` / `#ifndef` / `#if` blocks to split code and styles by
|
|
19
|
+
- **Conditional compilation** Use Taro-style `#ifdef` / `#ifndef` / `#if` blocks to split code and styles by WeChat / web target.
|
|
20
|
+
- **Workspace friendly** Supports standalone apps and monorepos, with npm, pnpm, Yarn, Bun, and other package managers.
|
|
20
21
|
- **Type-friendly** The project supports TypeScript all the way.
|
|
21
22
|
- **WeChat Skyline** Support WeChat Mini Program output with Skyline rendering mode.
|
|
22
23
|
|
|
23
24
|
## Quick start
|
|
24
25
|
|
|
25
|
-
Use `create-vite-taro` for new apps. It
|
|
26
|
+
Use `create-vite-taro` for new apps. It scaffolds a Vite 8 + React 19 + Tailwind CSS v4 + Taro 4 project.
|
|
26
27
|
|
|
27
28
|
### 1. Create and install
|
|
28
29
|
|
|
@@ -35,9 +36,9 @@ cd my-app
|
|
|
35
36
|
npm install
|
|
36
37
|
```
|
|
37
38
|
|
|
38
|
-
### 2. Configure WeChat App ID
|
|
39
|
+
### 2. Configure WeChat Mini Program App ID
|
|
39
40
|
|
|
40
|
-
The template creates `.env.local`. Set `VITE_PLUGIN_TARO_WECHAT_APP_ID` to your WeChat App ID.
|
|
41
|
+
The template creates `.env.local`. Set `VITE_PLUGIN_TARO_WECHAT_APP_ID` to your WeChat Mini Program App ID.
|
|
41
42
|
|
|
42
43
|
### 3. Run in development
|
|
43
44
|
|
package/README.md
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
# vite-plugin-taro
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/vite-plugin-taro)
|
|
4
|
+

|
|
4
5
|
[](LICENSE)
|
|
5
6
|
|
|
6
7
|
简体中文 | [English](README.en.md)
|
|
7
8
|
|
|
8
9
|
使用最新标准化前端技术栈 Vite 8、React 19 和 Tailwind CSS v4 构建微信小程序。
|
|
9
10
|
|
|
10
|
-
`vite-plugin-taro` 适用于希望使用 Taro 跨平台 React 组件和 API,但更偏好 Vite 而非 Taro webpack
|
|
11
|
+
`vite-plugin-taro` 适用于希望使用 Taro 跨平台 React 组件和 API,但更偏好 Vite 而非 Taro webpack 的应用。你只需要这个插件,就能构建完整的微信小程序。
|
|
11
12
|
|
|
12
13
|
在线演示:<https://sep2.github.io/vite-plugin-taro>。如何在本地运行,请参见[示例应用](https://github.com/sep2/vite-plugin-taro/tree/main/packages/loan-genius/README.md)。
|
|
13
14
|
|
|
14
|
-
- **一套代码,双端输出** 同一套 React/Taro 页面构建微信小程序与 H5。
|
|
15
15
|
- **原生 Vite 构建** 使用标准 Vite 8 配置,无需维护老旧的 webpack 配置,并支持所有 Vite 插件。
|
|
16
16
|
- **热更新** 微信小程序与 H5 都支持开发模式 watch,基于 Vite 8 热更新/快速重建即时预览。
|
|
17
17
|
- **依托成熟 Taro 能力** 复用久经实战检验的 Taro API 和组件,完整使用 Taro 跨端能力。
|
|
18
18
|
- **Tailwind 就绪** 内置 Tailwind CSS v4 支持,微信小程序与 H5 样式开箱即用。
|
|
19
|
-
- **条件编译** 支持 Taro 风格 `#ifdef` / `#ifndef` / `#if
|
|
19
|
+
- **条件编译** 支持 Taro 风格 `#ifdef` / `#ifndef` / `#if`,可按微信 / Web 裁剪代码和样式。
|
|
20
|
+
- **工作区友好** 支持普通项目与 monorepo,兼容 npm、pnpm、Yarn、Bun 等包管理器。
|
|
20
21
|
- **类型友好** 项目全链路支持 TypeScript。
|
|
21
22
|
- **微信 Skyline** 支持微信小程序 Skyline 渲染模式输出。
|
|
22
23
|
|
|
23
24
|
## 快速开始
|
|
24
25
|
|
|
25
|
-
新应用推荐使用 `create-vite-taro
|
|
26
|
+
新应用推荐使用 `create-vite-taro`。它会生成 Vite 8 + React 19 + Tailwind CSS v4 + Taro 4 项目。
|
|
26
27
|
|
|
27
28
|
### 1. 创建并安装
|
|
28
29
|
|
|
@@ -35,9 +36,9 @@ cd my-app
|
|
|
35
36
|
npm install
|
|
36
37
|
```
|
|
37
38
|
|
|
38
|
-
### 2.
|
|
39
|
+
### 2. 配置微信小程序 App Id
|
|
39
40
|
|
|
40
|
-
模板会创建 `.env.local`。请将 `VITE_PLUGIN_TARO_WECHAT_APP_ID`
|
|
41
|
+
模板会创建 `.env.local`。请将 `VITE_PLUGIN_TARO_WECHAT_APP_ID` 设置为你的微信小程序 App Id。
|
|
41
42
|
|
|
42
43
|
### 3. 开发模式运行
|
|
43
44
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-taro",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
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/plugin-framework-react": "npm:vite-plugin-taro-plugin-framework-react@0.1.
|
|
68
|
-
"@tarojs/react": "npm:vite-plugin-taro-react@0.1.
|
|
67
|
+
"@tarojs/plugin-framework-react": "npm:vite-plugin-taro-plugin-framework-react@0.1.6",
|
|
68
|
+
"@tarojs/react": "npm:vite-plugin-taro-react@0.1.6"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"react": "^19.0.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"vite": "^8.0.16"
|
|
80
80
|
},
|
|
81
81
|
"scripts": {
|
|
82
|
-
"build": "node ../../scripts/sync-plugin-readme.
|
|
82
|
+
"build": "node ../../scripts/sync-plugin-readme.ts && rm -rf dist && tsgo --project tsconfig.json",
|
|
83
83
|
"typecheck": "tsgo --project tsconfig.json --noEmit"
|
|
84
84
|
}
|
|
85
85
|
}
|