diff --git a/package.json b/package.json index 44525d18ce..282da820c6 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ "main": "lib/index", "files": [ "dist", - "!dist/common.js", "lib", "style" ], diff --git a/webpack.config.js b/webpack.config.js index 38c444506c..1093f3dd37 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,11 @@ const webpack = require('atool-build/lib/webpack'); module.exports = function(webpackConfig) { + // remove common.js + webpackConfig.plugins = webpackConfig.plugins.filter((plugin) => { + return !(plugin instanceof webpack.optimize.CommonsChunkPlugin); + }); + if (process.env.ANTD === 'WEBSITE') { const component = process.env.COMPONENT_STYLE; @@ -76,10 +81,5 @@ module.exports = function(webpackConfig) { ]; } - // remove common.js - if (webpackConfig.plugins[0].chunkNames === 'common') { - webpackConfig.plugins.shift(); - } - return webpackConfig; };