generator-mico-cli 0.2.25 → 0.2.26
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/generators/micro-react/templates/apps/layout/config/config.prod.development.ts +7 -0
- package/generators/micro-react/templates/apps/layout/config/config.prod.testing.ts +7 -0
- package/generators/micro-react/templates/apps/layout/config/config.prod.ts +1 -0
- package/generators/subapp-react/templates/homepage/config/config.prod.development.ts +8 -0
- package/generators/subapp-react/templates/homepage/config/config.prod.testing.ts +8 -0
- package/generators/subapp-react/templates/homepage/config/config.prod.ts +1 -0
- package/generators/subapp-react/templates/homepage/config/config.ts +7 -0
- package/package.json +1 -1
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
import { defineConfig } from '@umijs/max';
|
|
4
4
|
// 开发环境,不上传 sourcemap。调试时如有需要再解开
|
|
5
5
|
// import { applySentryPlugin } from "../../../scripts/apply-sentry-plugin";
|
|
6
|
+
const { CDN_PUBLIC_PATH } = process.env;
|
|
7
|
+
|
|
8
|
+
const PUBLIC_PATH: string = CDN_PUBLIC_PATH
|
|
9
|
+
? `${CDN_PUBLIC_PATH.replace(/\/?$/, '/')}layout/`
|
|
10
|
+
: '/layout/';
|
|
6
11
|
|
|
7
12
|
const config: ReturnType<typeof defineConfig> = {
|
|
8
13
|
// 开发环境,不上传 sourcemap。调试时如有需要再解开
|
|
@@ -19,6 +24,8 @@ const config: ReturnType<typeof defineConfig> = {
|
|
|
19
24
|
'react-dom': 'ReactDOM',
|
|
20
25
|
'@common-web/sentry': 'CommonWebSentry',
|
|
21
26
|
},
|
|
27
|
+
publicPath: PUBLIC_PATH,
|
|
28
|
+
cssPublicPath: PUBLIC_PATH,
|
|
22
29
|
define: {
|
|
23
30
|
'process.env.NODE_ENV': 'development',
|
|
24
31
|
'process.env.API_BASE_URL': 'https://dashboard-api-test.micoplatform.com',
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
import { defineConfig } from '@umijs/max';
|
|
4
4
|
// 测试环境,不上传 sourcemap。调试时如有需要再解开
|
|
5
5
|
// import { applySentryPlugin } from "../../../scripts/apply-sentry-plugin";
|
|
6
|
+
const { CDN_PUBLIC_PATH } = process.env;
|
|
7
|
+
|
|
8
|
+
const PUBLIC_PATH: string = CDN_PUBLIC_PATH
|
|
9
|
+
? `${CDN_PUBLIC_PATH.replace(/\/?$/, '/')}layout/`
|
|
10
|
+
: '/layout/';
|
|
6
11
|
|
|
7
12
|
const config: ReturnType<typeof defineConfig> = {
|
|
8
13
|
// 测试环境,不上传 sourcemap。调试时如有需要再解开
|
|
@@ -19,6 +24,8 @@ const config: ReturnType<typeof defineConfig> = {
|
|
|
19
24
|
'react-dom': 'ReactDOM',
|
|
20
25
|
'@common-web/sentry': 'CommonWebSentry',
|
|
21
26
|
},
|
|
27
|
+
publicPath: PUBLIC_PATH,
|
|
28
|
+
cssPublicPath: PUBLIC_PATH,
|
|
22
29
|
define: {
|
|
23
30
|
'process.env.NODE_ENV': 'testing',
|
|
24
31
|
'process.env.API_BASE_URL': 'https://dashboard-api-test.micoplatform.com',
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
import { defineConfig } from '@umijs/max';
|
|
4
4
|
// 开发环境,不上传 sourcemap。调试时如有需要再解开
|
|
5
5
|
// import { applySentryPlugin } from "../../../scripts/apply-sentry-plugin";
|
|
6
|
+
const { CDN_PUBLIC_PATH } = process.env;
|
|
7
|
+
|
|
8
|
+
const PUBLIC_PATH: string = CDN_PUBLIC_PATH
|
|
9
|
+
? `${CDN_PUBLIC_PATH.replace(/\/?$/, '/')}<%= appName %>/`
|
|
10
|
+
: '/<%= appName %>/';
|
|
6
11
|
|
|
7
12
|
const config: ReturnType<typeof defineConfig> = {
|
|
8
13
|
// 开发环境,不上传 sourcemap。调试时如有需要再解开
|
|
@@ -11,6 +16,9 @@ const config: ReturnType<typeof defineConfig> = {
|
|
|
11
16
|
// 测试环境:将所有代码打包到一个文件
|
|
12
17
|
extraBabelPlugins: ['babel-plugin-dynamic-import-node'],
|
|
13
18
|
|
|
19
|
+
publicPath: PUBLIC_PATH,
|
|
20
|
+
cssPublicPath: PUBLIC_PATH,
|
|
21
|
+
|
|
14
22
|
// 禁用代码分割,只输出一个 JS 和一个 CSS
|
|
15
23
|
chainWebpack(memo) {
|
|
16
24
|
// 禁用 splitChunks
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
import { defineConfig } from '@umijs/max';
|
|
4
4
|
// 测试环境,不上传 sourcemap。调试时如有需要再解开
|
|
5
5
|
// import { applySentryPlugin } from "../../../scripts/apply-sentry-plugin";
|
|
6
|
+
const { CDN_PUBLIC_PATH } = process.env;
|
|
7
|
+
|
|
8
|
+
const PUBLIC_PATH: string = CDN_PUBLIC_PATH
|
|
9
|
+
? `${CDN_PUBLIC_PATH.replace(/\/?$/, '/')}<%= appName %>/`
|
|
10
|
+
: '/<%= appName %>/';
|
|
6
11
|
|
|
7
12
|
const config: ReturnType<typeof defineConfig> = {
|
|
8
13
|
// 测试环境,不上传 sourcemap。调试时如有需要再解开
|
|
@@ -11,6 +16,9 @@ const config: ReturnType<typeof defineConfig> = {
|
|
|
11
16
|
// 测试环境:将所有代码打包到一个文件
|
|
12
17
|
extraBabelPlugins: ['babel-plugin-dynamic-import-node'],
|
|
13
18
|
|
|
19
|
+
publicPath: PUBLIC_PATH,
|
|
20
|
+
cssPublicPath: PUBLIC_PATH,
|
|
21
|
+
|
|
14
22
|
// 禁用代码分割,只输出一个 JS 和一个 CSS
|
|
15
23
|
chainWebpack(memo) {
|
|
16
24
|
// 禁用 splitChunks
|
|
@@ -30,6 +30,13 @@ const config: ReturnType<typeof defineConfig> = {
|
|
|
30
30
|
|
|
31
31
|
publicPath: PUBLIC_PATH,
|
|
32
32
|
|
|
33
|
+
// qiankun slave 插件默认开启 runtimePublicPath,会在构建时将 CSS url() 的 publicPath 覆盖为 '/'
|
|
34
|
+
// 生产环境 publicPath 已确定,删除该插件让 cssPublicPath 生效
|
|
35
|
+
chainWebpack(memo) {
|
|
36
|
+
memo.plugins.delete('runtimePublicPath');
|
|
37
|
+
return memo;
|
|
38
|
+
},
|
|
39
|
+
|
|
33
40
|
/**
|
|
34
41
|
* @name 运行时公共路径
|
|
35
42
|
* @description qiankun 微应用运行时动态设置 publicPath
|