在readme之后从Webpack 3迁移到Webpack 4之后
我的打字稿应用程序将webpack设置为mode: production
错误:
Uncaught TypeError: Object(...) is not a function
at Object.822 (Tag.tsx:65)
哪个映射到此行:
withExpertFeed(({removeAttribute}) => ({removeAttribute})),
此webpack配置有效:
module.exports = merge(common(), {
devtool: 'source-map',
mode: 'development', // Set to development
plugins: [
}),
new CopyWebpackPlugin([{
from: 'public',
}, ]),
new ForkTsCheckerWebpackPlugin({
checkSyntacticErrors: false,
tsconfig: '../web-tsconfig.json',
}),
new HtmlWebpackPlugin({
inject: true,
template: path.resolve(__dirname, 'public/index.html'),
filename: 'index.html',
minify: {
removeComments: true,
collapseWhitespace: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeStyleLinkTypeAttributes: true,
keepClosingSlash: true,
minifyJS: true,
minifyCSS: true,
minifyURLs: true,
},
}),
],
optimization: {
minimizer: [
new UglifyJSPlugin({
uglifyOptions: {
output: {
ascii_only: true,
},
},
parallel: true,
cache: true,
sourceMap: true
}),
]
}
});
设置mode: production
时,相同的webpack配置失败,并出现上述错误