@xfe-repo/mini-app 0.1.16 → 0.2.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/config/index.ts +28 -21
- package/deploy/.drone.yml +3 -9
- package/package.json +3 -3
package/config/index.ts
CHANGED
|
@@ -11,6 +11,10 @@ export const appProjectRootRelPath = path.relative(path.join(__dirname, '..'), a
|
|
|
11
11
|
// 获取API_ENV环境变量 此处注意 需要stringify为带引号的字符串 这样在webpack中才能正确解析
|
|
12
12
|
export const API_ENV = JSON.stringify(process.env.API_ENV || '')
|
|
13
13
|
|
|
14
|
+
export const XFE_JWT_AUD = JSON.stringify(process.env.XFE_JWT_AUD || '')
|
|
15
|
+
export const XFE_JWT_PRIVATE_KEY = JSON.stringify(process.env.XFE_JWT_PRIVATE_KEY || '')
|
|
16
|
+
export const XFE_JWT_KEY_ID = JSON.stringify(process.env.XFE_JWT_KEY_ID || '')
|
|
17
|
+
|
|
14
18
|
export default defineConfig<'webpack5'>(async (merge) => {
|
|
15
19
|
const baseConfig: UserConfigExport<'webpack5'> = {
|
|
16
20
|
projectName: 'xfe-mini',
|
|
@@ -27,24 +31,27 @@ export default defineConfig<'webpack5'>(async (merge) => {
|
|
|
27
31
|
// 项目输出 相对于当前文件
|
|
28
32
|
outputRoot: path.join(appProjectRootRelPath, 'dist', process.env.TARO_ENV || ''),
|
|
29
33
|
env: {
|
|
30
|
-
API_ENV
|
|
34
|
+
API_ENV,
|
|
35
|
+
XFE_JWT_AUD,
|
|
36
|
+
XFE_JWT_PRIVATE_KEY,
|
|
37
|
+
XFE_JWT_KEY_ID,
|
|
31
38
|
},
|
|
32
39
|
// 别名 需要注意 此处需要提供绝对路径
|
|
33
40
|
alias: {
|
|
34
41
|
react: path.join(appProjectRootAbsPath, 'node_modules/react'),
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
'@': path.join(appProjectRootAbsPath, 'src'),
|
|
43
|
+
'@common/services': '@xfe-repo/mini-service',
|
|
37
44
|
},
|
|
38
45
|
plugins: [],
|
|
39
46
|
defineConstants: {},
|
|
40
47
|
copy: {
|
|
41
48
|
patterns: [],
|
|
42
|
-
options: {}
|
|
49
|
+
options: {},
|
|
43
50
|
},
|
|
44
51
|
framework: 'react',
|
|
45
52
|
compiler: 'webpack5',
|
|
46
53
|
cache: {
|
|
47
|
-
enable: false // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
|
|
54
|
+
enable: false, // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
|
|
48
55
|
},
|
|
49
56
|
mini: {
|
|
50
57
|
miniCssExtractPluginOption: {
|
|
@@ -54,7 +61,7 @@ export default defineConfig<'webpack5'>(async (merge) => {
|
|
|
54
61
|
// 尺寸单位转换配置
|
|
55
62
|
pxtransform: {
|
|
56
63
|
enable: true,
|
|
57
|
-
config: {}
|
|
64
|
+
config: {},
|
|
58
65
|
},
|
|
59
66
|
// css引用本地资源内联配置
|
|
60
67
|
url: {
|
|
@@ -68,13 +75,13 @@ export default defineConfig<'webpack5'>(async (merge) => {
|
|
|
68
75
|
enable: true,
|
|
69
76
|
config: {
|
|
70
77
|
namingPattern: 'module',
|
|
71
|
-
generateScopedName: '[name]__[local]___[hash:base64:5]'
|
|
72
|
-
}
|
|
73
|
-
}
|
|
78
|
+
generateScopedName: '[name]__[local]___[hash:base64:5]',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
74
81
|
},
|
|
75
82
|
webpackChain(chain) {
|
|
76
83
|
chain.resolve.plugin('tsconfig-paths').use(TsconfigPathsPlugin)
|
|
77
|
-
}
|
|
84
|
+
},
|
|
78
85
|
},
|
|
79
86
|
h5: {
|
|
80
87
|
router: {
|
|
@@ -84,40 +91,40 @@ export default defineConfig<'webpack5'>(async (merge) => {
|
|
|
84
91
|
staticDirectory: 'static',
|
|
85
92
|
output: {
|
|
86
93
|
filename: 'js/[name].[hash:8].js',
|
|
87
|
-
chunkFilename: 'js/[name].[chunkhash:8].js'
|
|
94
|
+
chunkFilename: 'js/[name].[chunkhash:8].js',
|
|
88
95
|
},
|
|
89
96
|
miniCssExtractPluginOption: {
|
|
90
97
|
ignoreOrder: true,
|
|
91
98
|
filename: 'css/[name].[hash].css',
|
|
92
|
-
chunkFilename: 'css/[name].[chunkhash].css'
|
|
99
|
+
chunkFilename: 'css/[name].[chunkhash].css',
|
|
93
100
|
},
|
|
94
101
|
postcss: {
|
|
95
102
|
// 自动添加浏览器前缀
|
|
96
103
|
autoprefixer: {
|
|
97
104
|
enable: true,
|
|
98
|
-
config: {}
|
|
105
|
+
config: {},
|
|
99
106
|
},
|
|
100
107
|
// 开启 css modules 功能
|
|
101
108
|
cssModules: {
|
|
102
109
|
enable: true,
|
|
103
110
|
config: {
|
|
104
111
|
namingPattern: 'module',
|
|
105
|
-
generateScopedName: '[name]__[local]___[hash:base64:5]'
|
|
106
|
-
}
|
|
107
|
-
}
|
|
112
|
+
generateScopedName: '[name]__[local]___[hash:base64:5]',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
108
115
|
},
|
|
109
116
|
webpackChain(chain) {
|
|
110
117
|
chain.resolve.plugin('tsconfig-paths').use(TsconfigPathsPlugin)
|
|
111
|
-
}
|
|
118
|
+
},
|
|
112
119
|
},
|
|
113
120
|
rn: {
|
|
114
121
|
appName: 'xfe-mini',
|
|
115
122
|
postcss: {
|
|
116
123
|
cssModules: {
|
|
117
|
-
enable: true // 默认为 false,如需使用 css modules 功能,则设为 true
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
124
|
+
enable: true, // 默认为 false,如需使用 css modules 功能,则设为 true
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
121
128
|
}
|
|
122
129
|
if (process.env.NODE_ENV === 'development') {
|
|
123
130
|
// 本地开发构建配置(不混淆压缩)
|
package/deploy/.drone.yml
CHANGED
|
@@ -26,7 +26,7 @@ steps:
|
|
|
26
26
|
volumes:
|
|
27
27
|
- name: node-modules
|
|
28
28
|
host:
|
|
29
|
-
path: /var/lib/node/${DRONE_REPO_NAME}-node-modules
|
|
29
|
+
path: /var/lib/node/${DRONE_REPO_NAME}-node-modules-pnpm
|
|
30
30
|
|
|
31
31
|
image_pull_secrets:
|
|
32
32
|
- docker-key
|
|
@@ -95,7 +95,7 @@ steps:
|
|
|
95
95
|
volumes:
|
|
96
96
|
- name: node-modules
|
|
97
97
|
host:
|
|
98
|
-
path: /var/lib/node/${DRONE_REPO_NAME}-node-modules
|
|
98
|
+
path: /var/lib/node/${DRONE_REPO_NAME}-node-modules-pnpm
|
|
99
99
|
|
|
100
100
|
image_pull_secrets:
|
|
101
101
|
- docker-key
|
|
@@ -231,15 +231,9 @@ steps:
|
|
|
231
231
|
- refs/tags/release-*
|
|
232
232
|
|
|
233
233
|
volumes:
|
|
234
|
-
- name: socks
|
|
235
|
-
host:
|
|
236
|
-
path: /var/run
|
|
237
|
-
- name: docker
|
|
238
|
-
host:
|
|
239
|
-
path: /var/lib/docker
|
|
240
234
|
- name: node-modules
|
|
241
235
|
host:
|
|
242
|
-
path: /var/lib/node/${DRONE_REPO_NAME}-node-modules
|
|
236
|
+
path: /var/lib/node/${DRONE_REPO_NAME}-node-modules-pnpm
|
|
243
237
|
|
|
244
238
|
image_pull_secrets:
|
|
245
239
|
- docker-key
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xfe-repo/mini-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"bin": {
|
|
5
5
|
"xfe-mini": "./bin/index.js"
|
|
6
6
|
},
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"typescript": "5.5.4",
|
|
52
52
|
"webpack": "5.91.0",
|
|
53
53
|
"yaml": "^2.3.4",
|
|
54
|
-
"@xfe-repo/
|
|
55
|
-
"@xfe-repo/
|
|
54
|
+
"@xfe-repo/typescript-config": "0.0.6",
|
|
55
|
+
"@xfe-repo/routes-define-webpack-plugin": "0.0.3"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"react": "18.2.0",
|