1 Star 0 Fork 3

eyoonet / react-antd-admin-template

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
config-overrides.js 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
难凉热血 提交于 2020-06-02 15:19 . build: 修改config-overrides.js
const {
override,
fixBabelImports,
addLessLoader,
addWebpackAlias,
} = require("customize-cra");
const path = require("path");
function resolve(dir) {
return path.join(__dirname, dir);
}
process.env.CI = "false";
const addCustomize = () => (config) => {
if (config.output.publicPath) {
config.output.publicPath =
process.env.NODE_ENV === "production"
? "/react-antd-admin-template/"
: "/";
}
if (config.resolve) {
config.resolve.extensions.push(".jsx");
}
return config;
};
module.exports = override(
// 针对antd实现按需打包: 根据import来打包(使用babel-plugin-import)
fixBabelImports("import", {
libraryName: "antd",
libraryDirectory: "es",
style: true, // 自动打包相关的样式
}),
// 使用less-loader对源码中的less的变量进行重新指定
addLessLoader({
javascriptEnabled: true,
modifyVars: { "@primary-color": "#1DA57A" },
}),
// 配置路径别名
addWebpackAlias({
"@": resolve("src"),
}),
addCustomize()
);
JavaScript
1
https://gitee.com/eyoonet/react-antd-admin-template.git
git@gitee.com:eyoonet/react-antd-admin-template.git
eyoonet
react-antd-admin-template
react-antd-admin-template
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891