vite-plugin-taro 0.4.0 → 0.4.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/dist/node/plugins/wx/module.js +2 -1
- package/dist/node/plugins/wx/native/compile-native-component-interface.js +1 -1
- package/dist/node/utils/packages.d.ts +1 -1
- package/dist/node/utils/packages.js +3 -2
- package/package.json +3 -3
- package/src/node/plugins/wx/module.ts +2 -1
- package/src/node/plugins/wx/native/compile-native-component-interface.ts +1 -1
- package/src/node/utils/packages.ts +3 -2
|
@@ -36,6 +36,7 @@ export const pageShellPath = resolvePackageFile('dist/runtime/wx/native/page.js'
|
|
|
36
36
|
const shellModuleIds = new Set([appShellPath, componentShellPath, pageShellPath]);
|
|
37
37
|
const capsuleModuleIds = new Set([appCapsulePath, componentCapsulePath, pageCapsulePath]);
|
|
38
38
|
const amphibiousModuleIds = new Set([bootstrapPath, rolldownRuntimeId]);
|
|
39
|
+
const transportModuleIds = new Set([transportPath]);
|
|
39
40
|
/** Returns the one explicit lifecycle role owned by a chunk. */
|
|
40
41
|
export function getWxEntryRole(chunk) {
|
|
41
42
|
const ownsShell = containsModule(chunk, shellModuleIds);
|
|
@@ -47,7 +48,7 @@ export function getWxEntryRole(chunk) {
|
|
|
47
48
|
}
|
|
48
49
|
/** Tests whether a chunk contains the physical transport implementation. */
|
|
49
50
|
export function isTransportModule(chunk) {
|
|
50
|
-
return chunk
|
|
51
|
+
return containsModule(chunk, transportModuleIds);
|
|
51
52
|
}
|
|
52
53
|
/**
|
|
53
54
|
* Classifies one final output chunk by execution domain. Entry role is deliberately independent: explicit capsule entries
|
|
@@ -10,7 +10,7 @@ export async function compileNativeComponentInterface({ code, id, sourcemap, add
|
|
|
10
10
|
nativeComponents.forEach((source) => {
|
|
11
11
|
addWatchFile(source.folder);
|
|
12
12
|
source.assets.forEach((asset) => {
|
|
13
|
-
addWatchFile(path.join(source.folder, asset.relativePath));
|
|
13
|
+
addWatchFile(normalizeModuleId(path.join(source.folder, asset.relativePath)));
|
|
14
14
|
});
|
|
15
15
|
});
|
|
16
16
|
const assetBytes = nativeComponents.reduce((sourceTotal, source) => {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import { normalizeModuleId } from './modules.js';
|
|
3
4
|
export const packageRequire = createRequire(import.meta.url);
|
|
4
5
|
const packageRoot = path.dirname(packageRequire.resolve('vite-plugin-taro/package.json'));
|
|
5
|
-
/** Resolves a file shipped by this package. */
|
|
6
|
+
/** Resolves a file shipped by this package as a portable Vite module ID. */
|
|
6
7
|
export function resolvePackageFile(...segments) {
|
|
7
|
-
return path.join(packageRoot, ...segments);
|
|
8
|
+
return normalizeModuleId(path.join(packageRoot, ...segments));
|
|
8
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-taro",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.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",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"rolldown": "~1.2.2",
|
|
75
75
|
"tailwindcss": "^4.3.3",
|
|
76
76
|
"weapp-tailwindcss": "^5.2.11",
|
|
77
|
-
"@tarojs/
|
|
78
|
-
"@tarojs/react": "npm:vite-plugin-taro-react@0.4.
|
|
77
|
+
"@tarojs/react": "npm:vite-plugin-taro-react@0.4.1",
|
|
78
|
+
"@tarojs/plugin-framework-react": "npm:vite-plugin-taro-plugin-framework-react@0.4.1"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"react": "^19.0.0",
|
|
@@ -63,6 +63,7 @@ export type WxExecutionKind = 'native' | 'capsule' | 'amphibious'
|
|
|
63
63
|
const shellModuleIds: ReadonlySet<string> = new Set([appShellPath, componentShellPath, pageShellPath])
|
|
64
64
|
const capsuleModuleIds: ReadonlySet<string> = new Set([appCapsulePath, componentCapsulePath, pageCapsulePath])
|
|
65
65
|
const amphibiousModuleIds: ReadonlySet<string> = new Set([bootstrapPath, rolldownRuntimeId])
|
|
66
|
+
const transportModuleIds: ReadonlySet<string> = new Set([transportPath])
|
|
66
67
|
|
|
67
68
|
/** Returns the one explicit lifecycle role owned by a chunk. */
|
|
68
69
|
export function getWxEntryRole(chunk: WxChunk): WxEntryRole | undefined {
|
|
@@ -76,7 +77,7 @@ export function getWxEntryRole(chunk: WxChunk): WxEntryRole | undefined {
|
|
|
76
77
|
|
|
77
78
|
/** Tests whether a chunk contains the physical transport implementation. */
|
|
78
79
|
export function isTransportModule(chunk: WxChunk): boolean {
|
|
79
|
-
return chunk
|
|
80
|
+
return containsModule(chunk, transportModuleIds)
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
/**
|
|
@@ -26,7 +26,7 @@ export async function compileNativeComponentInterface({
|
|
|
26
26
|
addWatchFile(source.folder)
|
|
27
27
|
|
|
28
28
|
source.assets.forEach((asset) => {
|
|
29
|
-
addWatchFile(path.join(source.folder, asset.relativePath))
|
|
29
|
+
addWatchFile(normalizeModuleId(path.join(source.folder, asset.relativePath)))
|
|
30
30
|
})
|
|
31
31
|
})
|
|
32
32
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { createRequire } from 'node:module'
|
|
2
2
|
import path from 'node:path'
|
|
3
|
+
import { normalizeModuleId } from './modules.ts'
|
|
3
4
|
|
|
4
5
|
export const packageRequire = createRequire(import.meta.url)
|
|
5
6
|
const packageRoot = path.dirname(packageRequire.resolve('vite-plugin-taro/package.json'))
|
|
6
7
|
|
|
7
|
-
/** Resolves a file shipped by this package. */
|
|
8
|
+
/** Resolves a file shipped by this package as a portable Vite module ID. */
|
|
8
9
|
export function resolvePackageFile(...segments: string[]): string {
|
|
9
|
-
return path.join(packageRoot, ...segments)
|
|
10
|
+
return normalizeModuleId(path.join(packageRoot, ...segments))
|
|
10
11
|
}
|