Skip to content

Commit

Permalink
Upgrade to antd-tools@4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yesmeck committed Oct 19, 2017
1 parent 262822a commit 47783d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@types/react-native": "^0.47.2",
"antd": "2.x",
"antd-mobile-demo-data": "^0.1.1",
"antd-tools": "^2.0.0",
"antd-tools": "^4.0.1",
"babel-eslint": "^7.2.3",
"babel-plugin-import": "1.6.1",
"babel-plugin-transform-runtime": "^6.23.0",
Expand Down
23 changes: 8 additions & 15 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@ const getWebpackConfig = require('antd-tools/lib/getWebpackConfig');
const Visualizer = require('webpack-visualizer-plugin');
const pkg = require('./package.json');

module.exports = function (webpackConfig) {
// fix `npm run dist` sourceMap error, do not know the reason
delete webpackConfig.ts.compilerOptions.sourceMap;
const webpackConfig = getWebpackConfig(false);

webpackConfig = getWebpackConfig(webpackConfig, true);
if (!Array.isArray(webpackConfig)) {
webpackConfig = [webpackConfig, webpackConfig];
webpackConfig.forEach((config, index) => {
if (index === 0) {
config.plugins.push(new Visualizer({
filename: `../ant-design-analysis/${pkg.name}@${pkg.version}-stats.html`,
}));
}
webpackConfig.forEach((config, index) => {
if (index === 0) {
config.plugins.push(new Visualizer({
filename: `../ant-design-analysis/${pkg.name}@${pkg.version}-stats.html`,
}));
}
});
});

return webpackConfig;
};
module.exports = webpackConfig;

0 comments on commit 47783d5

Please sign in to comment.