Browse Source

Upgrade antd-tools

pull/7971/merge
Wei Zhu 7 years ago
parent
commit
4431c5d70d
  1. 2
      package.json
  2. 29
      webpack.config.js

2
package.json

@ -84,7 +84,7 @@
"devDependencies": {
"@types/react": "^15.0.38",
"@types/react-dom": "~0.14.18",
"antd-tools": "~3.0.0",
"antd-tools": "^4.0.1",
"babel-cli": "^6.18.0",
"babel-eslint": "^8.0.1",
"babel-plugin-import": "^1.0.0",

29
webpack.config.js

@ -19,13 +19,22 @@ function addLocales(webpackConfig) {
webpackConfig.output.filename = '[name].js';
}
module.exports = function (webpackConfig) {
webpackConfig = getWebpackConfig(webpackConfig, true);
if (process.env.RUN_ENV === 'PRODUCTION') {
webpackConfig.forEach((config) => {
ignoreMomentLocale(config);
addLocales(config);
});
}
return webpackConfig;
};
function externalMoment(config) {
config.externals.moment = {
root: 'moment',
commonjs2: 'moment',
commonjs: 'moment',
amd: 'moment',
};
}
const webpackConfig = getWebpackConfig(false);
if (process.env.RUN_ENV === 'PRODUCTION') {
webpackConfig.forEach((config) => {
ignoreMomentLocale(config);
externalMoment(config);
addLocales(config);
});
}
module.exports = webpackConfig[0];

Loading…
Cancel
Save