Skip to content

Commit e5ed773

Browse files
committed
init
1 parent d1c183f commit e5ed773

File tree

5 files changed

+1030
-257
lines changed

5 files changed

+1030
-257
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
## build
1111
`npm run build` or `yarn build`
1212

13-
## 配置参考
13+
## more config
1414
[@vue/cli3](https://cli.vuejs.org/zh/config/)
1515

1616
[webpack-chain](https://github.com/neutrinojs/webpack-chain)

babel.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ module.exports = {
66
'@babel/plugin-syntax-dynamic-import',
77
'@babel/plugin-proposal-class-properties',
88
'@babel/plugin-proposal-object-rest-spread',
9-
'@babel/plugin-proposal-export-namespace-from',
109
],
1110
};

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"build": "react-cli-service build --report"
1111
},
1212
"dependencies": {
13-
"react": "^16.8.6",
14-
"react-dom": "^16.8.6"
13+
"react": "^16.9.0",
14+
"react-dom": "^16.9.0"
1515
},
1616
"devDependencies": {
17-
"react-cli-service": "^1.6.2"
17+
"react-cli-service": "^1.7.7"
1818
}
1919
}

react.config.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,36 @@
55
* @see https://github.com/neutrinojs/webpack-chain
66
*/
77
module.exports = {
8-
devServer: {},
8+
publicPath: process.env.NODE_ENV === 'production' ? '.' : '/',
9+
productionSourceMap: false,
10+
css: {
11+
loaderOptions: {
12+
less: {
13+
javascriptEnabled: true,
14+
},
15+
},
16+
},
17+
devServer: {
18+
progress: false,
19+
proxy: {
20+
'/api2': {
21+
target: 'https://api.xxx.cn',
22+
},
23+
'/api': {
24+
target: 'http://localhost:8081',
25+
pathRewrite: { '^/api': '' },
26+
},
27+
},
28+
},
929
chainWebpack: config => {
30+
config.performance.hints(false);
31+
32+
// config.externals({ jquery: 'jQuery' });
33+
34+
// config.target('electron-renderer');
35+
36+
const { ContextReplacementPlugin: crp } = require('webpack');
1037

38+
config.plugin('context-replacement').use(crp, [/moment[\/\\]locale$/, /zh-cn/]);
1139
},
1240
};

0 commit comments

Comments
 (0)