Skip to content

Commit

Permalink
Upgrade antd-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
yesmeck committed Oct 19, 2017
1 parent 839703b commit 4431c5d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
29 changes: 19 additions & 10 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];

0 comments on commit 4431c5d

Please sign in to comment.