forked from pretty-derby/pretty-derby.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig-overrides.js
More file actions
25 lines (25 loc) · 859 Bytes
/
config-overrides.js
File metadata and controls
25 lines (25 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const {override,fixBabelImports} = require('customize-cra')
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
module.exports = override(
fixBabelImports('antd',{
libraryName:'antd',
libraryDirectory:'es',
style:'css'
}),
fixBabelImports('import',{
libraryName:'antd-mobile',
style:true
}),
(config) => {
// 在开发环境不修改 publicUrl
// config.plugins.push(new BundleAnalyzerPlugin({ analyzerPort: 8919 }))
if (process.env.NODE_ENV === "development") {
return config;
}
const paths = require("react-scripts/config/paths");
// 修改public path to github cdn
paths.publicUrl = "https://cdn.jsdelivr.net/gh/wrrwrr111/pretty-derby@master/build/";
config.output.publicPath = "https://cdn.jsdelivr.net/gh/wrrwrr111/pretty-derby@master/build/";
return config;
}
)