fix: 项目打包构建流程优化 & 补充说明

This commit is contained in:
GraceWalk
2022-09-13 11:43:30 +08:00
parent 2e016800e0
commit 4efe35dd51
16 changed files with 37265 additions and 65 deletions

View File

@@ -9,5 +9,4 @@ build/
coverage
versions/
debug.log
package-lock.json
yarn.lock

View File

@@ -1,6 +1,6 @@
## 使用说明
### 依赖安装:
### 依赖安装(如在 km-console 目录下执行 npm run i 安装过依赖,这步可以省略)
```
npm install
@@ -12,6 +12,8 @@ npm install
npm run start
```
该应用为子应用,启动后需要到基座应用中查看(需要启动基座应用),地址为 http://localhost:8000
### 构建:
```

File diff suppressed because it is too large Load Diff

View File

@@ -18,7 +18,7 @@
"scripts": {
"test": "echo \"Error: run tests from root\" && exit 1",
"start": "cross-env NODE_ENV=development webpack-dev-server",
"build": "rm -rf ../../pub/layout & cross-env NODE_ENV=production webpack --max_old_space_size=8000"
"build": "cross-env NODE_ENV=production webpack --max_old_space_size=8000"
},
"dependencies": {
"babel-preset-react-app": "^10.0.0",

View File

@@ -9,6 +9,5 @@ build/
coverage
versions/
debug.log
package-lock.json
yarn.lock
.d1-workspace.json

View File

@@ -1,6 +1,6 @@
## 使用说明
### 依赖安装:
### 依赖安装(如在 km-console 目录下执行 npm run i 安装过依赖,这步可以省略)
```
npm install
@@ -12,6 +12,8 @@ npm install
npm run start
```
启动后访问地址为 http://localhost:8000
### 构建:
```

File diff suppressed because it is too large Load Diff

View File

@@ -17,7 +17,7 @@
"scripts": {
"test": "echo \"Error: run tests from root\" && exit 1",
"start": "cross-env NODE_ENV=development webpack-dev-server",
"build": "rm -rf ../../pub/layout & cross-env NODE_ENV=production webpack --max_old_space_size=8000"
"build": "cross-env NODE_ENV=production webpack --max_old_space_size=8000"
},
"browserslist": {
"production": [

View File

@@ -15,11 +15,13 @@ module.exports = merge(getWebpackCommonConfig(), {
layout: ['./src/index.tsx'],
},
plugins: [
new CountPlugin({
pathname: 'knowdesign',
startCount: true,
isExportExcel: false,
}),
isProd
? new CountPlugin({
pathname: 'knowdesign',
startCount: true,
isExportExcel: false,
})
: undefined,
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
@@ -53,7 +55,7 @@ module.exports = merge(getWebpackCommonConfig(), {
: []
)
),
],
].filter((p) => p),
output: {
path: outPath,
publicPath: isProd ? process.env.PUBLIC_PATH + '/layout/' : '/',
@@ -79,11 +81,11 @@ module.exports = merge(getWebpackCommonConfig(), {
proxy: {
'/ks-km/api/v3': {
changeOrigin: true,
target: 'https://api-kylin-xg02.intra.xiaojukeji.com/ks-km/',
target: 'http://localhost:8080/',
},
'/logi-security/api/v1': {
changeOrigin: true,
target: 'https://api-kylin-xg02.intra.xiaojukeji.com/ks-km/',
target: 'http://localhost:8080/',
},
},
},