1 Star 0 Fork 224

siaoynli/dva-boot-admin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
config-overrides.js 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
毛睫(weiq) 提交于 2018-11-15 17:38 . :cake:fix build path problem
const path = require('path');
const { injectBabelPlugin } = require('react-app-rewired');
const rewireLess = require('react-app-rewire-less-modules');
const baseURL = require('./package.json').baseURL;
module.exports = function override(config, env) {
config.resolve = {
alias: {
'@': path.resolve(__dirname, 'src'),
components: path.resolve(__dirname, 'src/components'),
assets: path.resolve(__dirname, 'src/assets')
}
};
if (env === 'development') {
config = injectBabelPlugin(['dva-hmr'], config);
} else {
if (baseURL) {
config.output.publicPath = baseURL.slice(-1) !== '/' ? baseURL + '/' : baseURL; // 跟据实际项目设置
}
}
config = injectBabelPlugin('transform-decorators-legacy', config);
config = injectBabelPlugin(
['import', { libraryName: 'antd', style: true }],
config
);
config.externals = {};
return rewireLess.withLoaderOptions(
`${env === 'production' ? 'app' : '[local]'}-[hash:base64:8]`,
{
modifyVars: {}
}
)(config, env);
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/siaoynli/dva-boot-admin.git
git@gitee.com:siaoynli/dva-boot-admin.git
siaoynli
dva-boot-admin
dva-boot-admin
master

搜索帮助