create-vite-taro 0.3.2 → 0.4.0
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
CHANGED
|
@@ -1,60 +1,9 @@
|
|
|
1
1
|
# create-vite-taro
|
|
2
2
|
|
|
3
|
-
Create a Vite 8 + React 19 + Taro app for WeChat Mini Program and Web
|
|
4
|
-
|
|
5
|
-
## Quick start
|
|
3
|
+
Create a Vite 8 + React 19 + Taro app for WeChat Mini Program and Web targets.
|
|
6
4
|
|
|
7
5
|
```sh
|
|
8
|
-
# Create a new app from the default template
|
|
9
6
|
npm create vite-taro@latest my-app
|
|
10
|
-
|
|
11
|
-
# Or create with pnpm
|
|
12
|
-
pnpm --config.minimum-release-age=0 create vite-taro@latest my-app
|
|
13
|
-
|
|
14
|
-
# Enter the project and install dependencies
|
|
15
|
-
cd my-app
|
|
16
|
-
npm install
|
|
17
|
-
|
|
18
|
-
# WeChat Mini Program: start Vite with hot reload
|
|
19
|
-
npm run dev:wx
|
|
20
|
-
|
|
21
|
-
# Web/H5: start the Vite dev server
|
|
22
|
-
npm run dev:h5
|
|
23
|
-
|
|
24
|
-
# Then open the standard Vite dev URL in your browser
|
|
25
|
-
# http://localhost:5173
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
You can keep `npm run dev:wx` and `npm run dev:h5` running at the same time in separate terminals.
|
|
29
|
-
|
|
30
|
-
WeChat development fully supports Vite-powered hot reload. JavaScript edits preserve the active native page and React/input state, while other changes are rebuilt automatically.
|
|
31
|
-
|
|
32
|
-
Set `VITE_PLUGIN_TARO_WECHAT_APP_ID` in the generated `.env.local` to your WeChat Mini Program App ID, then open `dist/wx` with WeChat DevTools for Mini Program development.
|
|
33
|
-
|
|
34
|
-
The generated app keeps global styles in `src/app.css` and includes Tailwind CSS v4 plus Taro component styles out of the box.
|
|
35
|
-
|
|
36
|
-
## Other package managers
|
|
37
|
-
|
|
38
|
-
```sh
|
|
39
|
-
pnpm --config.minimum-release-age=0 create vite-taro@latest my-app
|
|
40
|
-
yarn create vite-taro my-app
|
|
41
|
-
bun create vite-taro my-app
|
|
42
7
|
```
|
|
43
8
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
| Command | Description |
|
|
47
|
-
| --- | --- |
|
|
48
|
-
| `npm run dev:wx` | Start WeChat Mini Program development with hot reload. |
|
|
49
|
-
| `npm run dev:h5` | Start the Web/H5 dev server. |
|
|
50
|
-
| `npm run build:wx` | Build the WeChat Mini Program output into `dist/wx`. |
|
|
51
|
-
| `npm run build:h5` | Build the Web/H5 output into `dist/h5`. |
|
|
52
|
-
| `npm run preview:h5` | Preview the built Web/H5 output. |
|
|
53
|
-
| `npm run typecheck` | Typecheck with `tsc`. |
|
|
54
|
-
|
|
55
|
-
## Troubleshooting
|
|
56
|
-
|
|
57
|
-
| Problem | Check |
|
|
58
|
-
| --- | --- |
|
|
59
|
-
| `pnpm install` says dependency build scripts were ignored | Run `pnpm approve-builds` and approve the requested dependency build scripts. |
|
|
60
|
-
|
|
9
|
+
Continue with the [Quick Start guide](https://vite-plugin-taro.netlify.app/guides/quick-start/), or browse the [complete documentation](https://vite-plugin-taro.netlify.app).
|
package/package.json
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Vite 8 + React 19 + Taro app generated by `create-vite-taro`.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Documentation: <https://vite-plugin-taro.netlify.app>
|
|
6
|
+
|
|
7
|
+
Source: <https://github.com/sep2/vite-plugin-taro>
|
|
6
8
|
|
|
7
9
|
## Quick start
|
|
8
10
|
|
|
@@ -22,11 +24,19 @@ npm run dev:h5
|
|
|
22
24
|
|
|
23
25
|
You can keep `npm run dev:wx` and `npm run dev:h5` running at the same time in separate terminals.
|
|
24
26
|
|
|
25
|
-
Set `VITE_PLUGIN_TARO_WECHAT_APP_ID` in `.env.local` to your WeChat App ID, then open `dist/wx` with WeChat DevTools
|
|
27
|
+
Set `VITE_PLUGIN_TARO_WECHAT_APP_ID` in `.env.local` to your WeChat App ID, then open `dist/wx` with WeChat DevTools
|
|
28
|
+
for Mini Program development. State-preserving hot reload requires `compileHotReLoad: true`; the generated project sets
|
|
29
|
+
it automatically and also disables Skyline rendering and URL checks by default.
|
|
26
30
|
|
|
27
31
|
## Styles
|
|
28
32
|
|
|
29
|
-
Global styles live in `src/app.css`. Keep the Tailwind subpath imports and `@source "./";` line so Tailwind CSS v4 works
|
|
33
|
+
Global styles live in `src/app.css`. Keep the Tailwind subpath imports and `@source "./";` line so Tailwind CSS v4 works
|
|
34
|
+
for both targets. Taro H5 component styles are injected by the plugin.
|
|
35
|
+
|
|
36
|
+
For WeChat, application CSS is currently emitted through `app.wxss`. CSS edits therefore rebuild and reload the App,
|
|
37
|
+
unlike JavaScript hot updates, which preserve App, React, and input state. WeChat DevTools preserves the App
|
|
38
|
+
and Page instance for direct `page.wxss` edits. Route-scoped, state-preserving WXSS hot reload will be supported in an
|
|
39
|
+
upcoming release.
|
|
30
40
|
|
|
31
41
|
## Scripts
|
|
32
42
|
|
|
File without changes
|