From 34fda2d3b0155f6379136a20d76c7620863b38c5 Mon Sep 17 00:00:00 2001 From: abhijithvijayan <34790378+abhijithvijayan@users.noreply.github.com> Date: Sun, 15 Nov 2020 15:31:52 +0530 Subject: [PATCH] fix: webpack loaders & plugins API changes --- webpack.config.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index e9a43ae..6489867 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -110,11 +110,18 @@ module.exports = { }, }, { - loader: 'postcss-loader', // For autoprefixer + loader: 'postcss-loader', options: { - ident: 'postcss', - // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires - plugins: [require('autoprefixer')()], + postcssOptions: { + plugins: [ + [ + 'autoprefixer', + { + // Options + }, + ], + ], + }, }, }, 'resolve-url-loader', // Rewrites relative paths in url() statements @@ -161,18 +168,20 @@ module.exports = { // write css file(s) to build folder new MiniCssExtractPlugin({filename: 'css/[name].css'}), // copy static assets - new CopyWebpackPlugin([{from: 'source/assets', to: 'assets'}]), + new CopyWebpackPlugin({ + patterns: [{from: 'source/assets', to: 'assets'}], + }), // plugin to enable browser reloading in development mode extensionReloaderPlugin, ], optimization: { + minimize: true, minimizer: [ new TerserPlugin({ - cache: true, parallel: true, terserOptions: { - output: { + format: { comments: false, }, },