vite-plugin-taro 0.7.5 → 0.7.7
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 +23 -11
- package/README.md +19 -7
- package/dist/index.js +114 -83
- package/dist/node/plugins/mini/module/module.d.ts +1 -1
- package/dist/node/plugins/mini/watch/create-mini-watch-plugin.d.ts +3 -2
- package/dist/options.d.ts +7 -3
- package/dist/runtime/global/vpt-global.js +4 -0
- package/package.json +9 -8
|
@@ -5,7 +5,7 @@ export declare const miniRuntimeId: string;
|
|
|
5
5
|
export declare const rolldownRuntimeId = "\0rolldown/runtime.js";
|
|
6
6
|
/** Identifies the virtual binding shared by native files, SystemJS capsules and HMR factories. */
|
|
7
7
|
export declare const vptGlobalBindingId = "\0vpt:global-binding";
|
|
8
|
-
/** Generates the selected core-js imports
|
|
8
|
+
/** Generates the selected core-js imports loaded by bootstrap from the native polyfill chunk. */
|
|
9
9
|
export declare const miniPolyfillsId = "\0vpt:mini-polyfills";
|
|
10
10
|
/** External bootstrap dependency emitted only after the bundled graph is finalized. */
|
|
11
11
|
export declare const miniTransportId = "\0vpt:mini-transport";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import type { VptTarget } from '../../../../options.ts';
|
|
3
|
+
/** Preserves watched directories and forces full reloads for Mini Program watch output without changing serve HMR. */
|
|
4
|
+
export declare function createMiniWatchPlugin(target: VptTarget): Plugin;
|
package/dist/options.d.ts
CHANGED
|
@@ -70,7 +70,10 @@ export interface VptOptions {
|
|
|
70
70
|
*/
|
|
71
71
|
appJson: VptAppConfig;
|
|
72
72
|
/**
|
|
73
|
-
* Native development-tool project configuration
|
|
73
|
+
* Native development-tool project configuration. Mini Program watch builds disable native hot reload in output:
|
|
74
|
+
* WX forces `setting.compileHotReLoad: false`; ZFB forces `developOptions.hotReload: false`; TT forces top-level
|
|
75
|
+
* `compileHotReload: false` and `setting.compileHotReLoad: false`, preserving `setting.autoCompile`.
|
|
76
|
+
* Other builds write it without merging.
|
|
74
77
|
*
|
|
75
78
|
* WX emits `project.config.json`; ZFB emits `mini.project.json`; TT emits `project.config.json`; H5 ignores it. Supply the schema
|
|
76
79
|
* expected by the selected target rather than sharing one project's platform-specific values across invocations. ZFB must
|
|
@@ -79,7 +82,8 @@ export interface VptOptions {
|
|
|
79
82
|
*/
|
|
80
83
|
projectConfigJson: VptJsonObject;
|
|
81
84
|
/**
|
|
82
|
-
* Local development-tool preferences
|
|
85
|
+
* Local development-tool preferences. WX and TT watch builds force `setting.compileHotReLoad: false` in emitted
|
|
86
|
+
* preferences; ZFB preferences and other builds are written without merging.
|
|
83
87
|
*
|
|
84
88
|
* WX emits `project.private.config.json`; ZFB emits `.mini-ide/project-ide.json`; TT emits `project.private.config.json`;
|
|
85
89
|
* H5 ignores it. TT private configuration requires TikTok DevTools 4.0.7+ and supports only its documented fields.
|
|
@@ -98,7 +102,7 @@ export interface VptOptions {
|
|
|
98
102
|
*
|
|
99
103
|
* Use core-js module names without the `core-js/modules/` prefix or `.js` suffix; no separate core-js installation is needed.
|
|
100
104
|
* For example, `web.url` provides `URL` and `URLSearchParams`, while `es.array.at` provides `Array.prototype.at`.
|
|
101
|
-
*
|
|
105
|
+
* Installed APIs support both `globalThis` access and unshadowed bare identifiers on every mini target.
|
|
102
106
|
*
|
|
103
107
|
* Selected polyfills run before your app in development and production, updating global APIs and prototypes when needed.
|
|
104
108
|
* Omit this option or use `[]` to add no optional polyfills. H5 ignores this option.
|
|
@@ -27,6 +27,10 @@ function getGlobalThis() {
|
|
|
27
27
|
configurable: true
|
|
28
28
|
});
|
|
29
29
|
resolved = __vpt_global__;
|
|
30
|
+
if (!resolved) {
|
|
31
|
+
console.error('Unable to resolve globalThis, might in strict mode');
|
|
32
|
+
resolved = getOrCreateFakeGlobal();
|
|
33
|
+
}
|
|
30
34
|
}
|
|
31
35
|
catch (cause) {
|
|
32
36
|
console.error('Unable to resolve globalThis', cause);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-taro",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.7",
|
|
4
4
|
"author": "sep2",
|
|
5
5
|
"description": "Vite 8 plugin for building one React/Taro codebase for WeChat, Alipay, TikTok, and H5 targets.",
|
|
6
6
|
"type": "module",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"README.en.md"
|
|
39
39
|
],
|
|
40
40
|
"keywords": [
|
|
41
|
+
"vpt",
|
|
41
42
|
"vite",
|
|
42
43
|
"vite-plugin",
|
|
43
44
|
"taro",
|
|
@@ -63,10 +64,10 @@
|
|
|
63
64
|
"core-js": "^3.50.0",
|
|
64
65
|
"lightningcss": "1.33.0",
|
|
65
66
|
"react-reconciler": "0.34.0",
|
|
66
|
-
"rolldown": "1.2.
|
|
67
|
+
"rolldown": "1.2.9",
|
|
67
68
|
"sval": "0.6.12",
|
|
68
69
|
"tailwindcss": "^4.3.3",
|
|
69
|
-
"vite-plugin-taro-runtime": "0.7.
|
|
70
|
+
"vite-plugin-taro-runtime": "0.7.7"
|
|
70
71
|
},
|
|
71
72
|
"peerDependencies": {
|
|
72
73
|
"react": "^19.3.0",
|
|
@@ -74,19 +75,19 @@
|
|
|
74
75
|
"vite": "8.3.0"
|
|
75
76
|
},
|
|
76
77
|
"devDependencies": {
|
|
77
|
-
"@babel/core": "^8.0.
|
|
78
|
-
"@babel/generator": "^8.0.
|
|
78
|
+
"@babel/core": "^8.0.6",
|
|
79
|
+
"@babel/generator": "^8.0.6",
|
|
79
80
|
"@babel/plugin-transform-dynamic-import": "^8.0.1",
|
|
80
81
|
"@babel/plugin-transform-modules-commonjs": "^8.0.1",
|
|
81
82
|
"@babel/plugin-transform-modules-systemjs": "^8.0.1",
|
|
82
|
-
"@oxc-project/types": "0.
|
|
83
|
+
"@oxc-project/types": "0.150.0",
|
|
83
84
|
"@tailwindcss-mangle/engine": "0.2.0",
|
|
84
|
-
"@types/node": "^26.
|
|
85
|
+
"@types/node": "^26.6.2",
|
|
85
86
|
"@types/react": "^19.3.0",
|
|
86
87
|
"@types/react-dom": "^19.3.0",
|
|
87
88
|
"@types/react-refresh": "^0.14.7",
|
|
88
89
|
"@weapp-core/escape": "8.0.0",
|
|
89
|
-
"@weapp-tailwindcss/postcss": "3.3.
|
|
90
|
+
"@weapp-tailwindcss/postcss": "3.3.5",
|
|
90
91
|
"c8": "^12.0.0",
|
|
91
92
|
"oxc-walker": "1.1.1",
|
|
92
93
|
"picocolors": "^1.1.1",
|