@tarojs/taro 4.3.0 → 4.3.1-alpha.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/taro",
|
|
3
|
-
"version": "4.3.0",
|
|
3
|
+
"version": "4.3.1-alpha.0",
|
|
4
4
|
"description": "Taro framework",
|
|
5
5
|
"author": "O2Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@types/postcss-url": "^10.0.4",
|
|
27
|
-
"@tarojs/api": "4.3.0",
|
|
28
|
-
"@tarojs/runtime": "4.3.0"
|
|
27
|
+
"@tarojs/api": "4.3.1-alpha.0",
|
|
28
|
+
"@tarojs/runtime": "4.3.1-alpha.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"html-webpack-plugin": "^5.6.0",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"webpack-chain": "^6.5.1",
|
|
34
34
|
"webpack-dev-server": "^4.15.2",
|
|
35
35
|
"rollup": "^3.29.4",
|
|
36
|
-
"@tarojs/components": "4.3.0",
|
|
37
|
-
"@tarojs/
|
|
38
|
-
"@tarojs/
|
|
36
|
+
"@tarojs/components": "4.3.1-alpha.0",
|
|
37
|
+
"@tarojs/helper": "4.3.1-alpha.0",
|
|
38
|
+
"@tarojs/shared": "4.3.1-alpha.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@types/react": "^18",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"webpack": "^5",
|
|
47
47
|
"webpack-chain": "^6",
|
|
48
48
|
"webpack-dev-server": "^4",
|
|
49
|
-
"@tarojs/
|
|
50
|
-
"@tarojs/helper": "4.3.0",
|
|
51
|
-
"@tarojs/
|
|
49
|
+
"@tarojs/shared": "4.3.1-alpha.0",
|
|
50
|
+
"@tarojs/helper": "4.3.1-alpha.0",
|
|
51
|
+
"@tarojs/components": "4.3.1-alpha.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependenciesMeta": {
|
|
54
54
|
"@types/react": {
|
|
@@ -15,6 +15,31 @@ interface Runtime {
|
|
|
15
15
|
enableMutationObserver?: boolean
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* `mini.sharedRuntimeWebpackChain` 钩子收到的第三个参数:当前运行时核子构建的核心信息。
|
|
20
|
+
* 同步核与异步核各调用一次钩子,`name` 区分。
|
|
21
|
+
*/
|
|
22
|
+
export interface ISharedRuntimeChainData {
|
|
23
|
+
/** 当前核:'taro-shared-sync'(同步核)| 'async-provider'(异步核),与产物文件名一致 */
|
|
24
|
+
name: string
|
|
25
|
+
/** 产物 emit 目标相对 outputDir 的目录:同步核为 ''(根),异步核为 'shared-async-v1' */
|
|
26
|
+
emitTo: string
|
|
27
|
+
/** 异步核加载路径(require.async 目标),业务 config 的 sharedRuntimeAsyncRequest 覆盖值或默认值 */
|
|
28
|
+
asyncRequest: string
|
|
29
|
+
/** config.mini.sharedRuntimeExtraPackages:随异步核加载的额外共享包 */
|
|
30
|
+
extraPackages: string[]
|
|
31
|
+
/** config.mini.sharedRuntimeSyncExtraPackages:随同步核加载的额外共享包 */
|
|
32
|
+
syncExtraPackages: string[]
|
|
33
|
+
/** 从 runtimePath 自动识别、被作为同步核额外入口的平台插件 runtime(plugin-html 等) */
|
|
34
|
+
missingRuntimes: string[]
|
|
35
|
+
/** 业务项目根目录 */
|
|
36
|
+
appPath: string
|
|
37
|
+
/** 产物输出目录(dist) */
|
|
38
|
+
outputDir: string
|
|
39
|
+
/** 平台全局对象名,如 'wx' */
|
|
40
|
+
globalObject: string
|
|
41
|
+
}
|
|
42
|
+
|
|
18
43
|
export interface IMiniAppConfig<T extends CompilerTypes = CompilerWebpackTypes> {
|
|
19
44
|
/** 用于控制是否生成 js、css 对应的 sourceMap (默认值:watch 模式下为 true,否则为 false) */
|
|
20
45
|
enableSourceMap?: boolean
|
|
@@ -100,6 +125,43 @@ export interface IMiniAppConfig<T extends CompilerTypes = CompilerWebpackTypes>
|
|
|
100
125
|
/** 插件内部使用 */
|
|
101
126
|
runtime?: Runtime
|
|
102
127
|
|
|
128
|
+
/**
|
|
129
|
+
* 共享运行时(split 模式):额外纳入共享的运行时包名列表。
|
|
130
|
+
* 用于把业务自研的运行时 API 也一并 external 到共享运行时全局,随异步核共享一份。
|
|
131
|
+
* 仅在使用 `--shared-runtime --shared-runtime-mode split` 编译时生效。
|
|
132
|
+
*/
|
|
133
|
+
sharedRuntimeExtraPackages?: string[]
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* 共享运行时(split 模式):需要在**同步核**阶段就执行副作用的额外共享包名列表。
|
|
137
|
+
* 与 `sharedRuntimeExtraPackages` 平行——后者随异步核加载(`.then` 回调,晚于首屏 onLoad),
|
|
138
|
+
* 前者随业务 app.js 顶层同步 `require` 立即执行。适用于必须先于首屏 window `INIT`
|
|
139
|
+
* 事件广播就注册监听器/设置全局状态的场景(如 rem 根字号计算的 `window.on(CONTEXT_ACTIONS.INIT)`
|
|
140
|
+
* 注册)。代价:每个业务包各自打包一份(不共享),故此清单应仅放**必须首屏就位**的极小内容。
|
|
141
|
+
* 仅在 `--shared-runtime --shared-runtime-mode split` 编译时生效。
|
|
142
|
+
*/
|
|
143
|
+
sharedRuntimeSyncExtraPackages?: string[]
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* 共享运行时(split 模式):自定义两个运行时核(同步核 taro-shared-sync / 异步核
|
|
147
|
+
* async-provider)各自独立 webpack 子构建的配置。
|
|
148
|
+
*
|
|
149
|
+
* 背景:这两个子构建与主构建**完全独立**——主构建的 `webpackChain` / `modifyWebpackChain`
|
|
150
|
+
* 只作用于主 chain,对两核无效。此前接入方没有任何入口可定制它们;而
|
|
151
|
+
* `sharedRuntimeExtraPackages` 引入的私有 runtime 若需要 loader / resolve 级定制
|
|
152
|
+
* (如私有语法插件、特殊 alias),必须从这里改。
|
|
153
|
+
*
|
|
154
|
+
* 同步核、异步核各调用一次本钩子,`data.name` 区分当前是哪个核
|
|
155
|
+
* (`'taro-shared-sync'` / `'async-provider'`,与产物文件名一致)。
|
|
156
|
+
*
|
|
157
|
+
* 注意:两个子构建默认已内置 ES5 转译(babel-loader + 业务项目 babel 配置)与
|
|
158
|
+
* `regenerator-runtime` alias,一般无需再配置;本钩子用于在此之上的微调
|
|
159
|
+
* (追加 loader、改 resolve、追加 plugin 等),不建议移除内置的 babel 规则。
|
|
160
|
+
*
|
|
161
|
+
* 仅在使用 `--shared-runtime --shared-runtime-mode split` 编译时生效。
|
|
162
|
+
*/
|
|
163
|
+
sharedRuntimeWebpackChain?: (chain: Chain, webpack: typeof Webpack, data: ISharedRuntimeChainData) => void
|
|
164
|
+
|
|
103
165
|
/** 使用的编译工具。可选值:webpack5、vite */
|
|
104
166
|
compiler?: Compiler<T>
|
|
105
167
|
|