1 Star 0 Fork 0

Andy/ant-design

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.config.js 883 Bytes
一键复制 编辑 原始数据 按行查看 历史
// This config is for building dist files
const webpack = require('webpack');
const getWebpackConfig = require('antd-tools/lib/getWebpackConfig');
// noParse still leave `require('./locale' + name)` in dist files
// ignore is better
// http://stackoverflow.com/q/25384360
function ignoreMomentLocale(webpackConfig) {
delete webpackConfig.module.noParse;
webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/));
}
// Fix ie8 compatibility
function es3ify(webpackConfig) {
webpackConfig.module.loaders.unshift({
test: /\.(tsx|jsx?)$/,
loader: 'es3ify-loader',
});
}
module.exports = function (webpackConfig) {
webpackConfig = getWebpackConfig(webpackConfig);
if (process.env.RUN_ENV === 'PRODUCTION') {
webpackConfig.forEach((config) => {
es3ify(config);
ignoreMomentLocale(config);
});
}
return webpackConfig;
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/hulon/ant-design.git
git@gitee.com:hulon/ant-design.git
hulon
ant-design
ant-design
master

搜索帮助