@xfe-repo/mini-app 1.6.2 → 1.6.4
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 +4 -0
- package/babel.config.js +20 -6
- package/config/index.ts +9 -1
- package/config/prod.ts +6 -1
- package/deploy/.drone.yml +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/babel.config.js
CHANGED
|
@@ -2,10 +2,24 @@
|
|
|
2
2
|
// https://docs.taro.zone/docs/next/babel-config
|
|
3
3
|
module.exports = {
|
|
4
4
|
presets: [
|
|
5
|
-
[
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
[
|
|
6
|
+
'taro',
|
|
7
|
+
{
|
|
8
|
+
framework: 'react',
|
|
9
|
+
ts: true,
|
|
10
|
+
compiler: 'webpack5',
|
|
11
|
+
targets:
|
|
12
|
+
process.env.TARO_ENV === 'h5'
|
|
13
|
+
? {
|
|
14
|
+
edge: '18',
|
|
15
|
+
chrome: '64',
|
|
16
|
+
firefox: '60',
|
|
17
|
+
safari: '12',
|
|
18
|
+
ios: '9',
|
|
19
|
+
android: '5',
|
|
20
|
+
}
|
|
21
|
+
: undefined,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
],
|
|
11
25
|
}
|
package/config/index.ts
CHANGED
|
@@ -115,8 +115,16 @@ export default defineConfig<'webpack5'>(async (merge) => {
|
|
|
115
115
|
},
|
|
116
116
|
},
|
|
117
117
|
},
|
|
118
|
-
webpackChain(chain) {
|
|
118
|
+
webpackChain(chain, webpack) {
|
|
119
119
|
chain.resolve.plugin('tsconfig-paths').use(TsconfigPathsPlugin)
|
|
120
|
+
// 保留应用为 Taro 预编译的首个入口,polyfill 由 Webpack 优先加载。
|
|
121
|
+
chain
|
|
122
|
+
.plugin('h5-polyfill')
|
|
123
|
+
.use(webpack.EntryPlugin, [
|
|
124
|
+
appProjectRootAbsPath,
|
|
125
|
+
require.resolve('core-js/stable', { paths: [require.resolve('babel-preset-taro')] }),
|
|
126
|
+
{ name: 'app' },
|
|
127
|
+
])
|
|
120
128
|
},
|
|
121
129
|
},
|
|
122
130
|
rn: {
|
package/config/prod.ts
CHANGED
|
@@ -5,5 +5,10 @@ export default {
|
|
|
5
5
|
NODE_ENV: '"production"',
|
|
6
6
|
},
|
|
7
7
|
mini: {},
|
|
8
|
-
h5: {
|
|
8
|
+
h5: {
|
|
9
|
+
compile: {
|
|
10
|
+
// 工作区依赖可能解析到 node_modules 外,也需要转译。
|
|
11
|
+
include: [(filename: string) => !/node_modules[/\\](@babel|core-js|style-loader|css-loader|react|react-dom)[/\\]/.test(filename)],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
9
14
|
} satisfies UserConfigExport<'webpack5'>
|
package/deploy/.drone.yml
CHANGED