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/H5 targets.
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
- ## Scripts
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vite-taro",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "Create Vite 8 + React 19 + Taro apps for H5 and WeChat Mini Program targets.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,7 +2,9 @@
2
2
 
3
3
  Vite 8 + React 19 + Taro app generated by `create-vite-taro`.
4
4
 
5
- Docs and source: <https://github.com/sep2/vite-plugin-taro>
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 for Mini Program development. The generated project enables hot reload and disables Skyline rendering and URL checks by default.
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 for both targets. Taro H5 component styles are injected by the plugin.
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
 
@@ -21,7 +21,7 @@
21
21
  "@types/react-dom": "^19.2.3",
22
22
  "typescript": "^7.0.2",
23
23
  "cross-env": "^10.1.0",
24
- "vite": "^8.1.4",
25
- "vite-plugin-taro": "^0.3.2"
24
+ "vite": "^8.2.0",
25
+ "vite-plugin-taro": "^0.4.0"
26
26
  }
27
27
  }
@@ -10,6 +10,7 @@
10
10
  /* Bundler mode */
11
11
  "moduleResolution": "bundler",
12
12
  "allowImportingTsExtensions": true,
13
+ "allowJs": true,
13
14
  "verbatimModuleSyntax": true,
14
15
  "moduleDetection": "force",
15
16
  "noEmit": true,
@@ -28,7 +28,7 @@ export default defineConfig(({ mode }) => {
28
28
  plugins: [
29
29
  vitePluginTaro({
30
30
  target,
31
- app: 'src/app.ts',
31
+ app: 'src/app.tsx',
32
32
  pages: [
33
33
  {
34
34
  path: 'pages/index/index',
File without changes