webpack updated to ver 5

This commit is contained in:
Maxim Kadushkin 2021-03-22 11:42:10 +03:00
parent db7c7343c5
commit b0a3d7be7f
2 changed files with 11 additions and 13 deletions

View file

@ -4,7 +4,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin'); const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin');
const WorkboxPlugin = require('workbox-webpack-plugin'); const WorkboxPlugin = require('workbox-webpack-plugin');
@ -53,6 +53,7 @@ module.exports = {
minimizer: [new TerserPlugin({ minimizer: [new TerserPlugin({
sourceMap: true, sourceMap: true,
})], })],
moduleIds: 'named',
}, },
module: { module: {
rules: [ rules: [
@ -162,8 +163,8 @@ module.exports = {
}), }),
...(env === 'production' ? [ ...(env === 'production' ? [
new OptimizeCSSPlugin({ new CssMinimizerPlugin({
cssProcessorOptions: { processorOptions: {
safe: true, safe: true,
map: { inline: false }, map: { inline: false },
}, },
@ -172,7 +173,7 @@ module.exports = {
] : [ ] : [
// Development only plugins // Development only plugins
new webpack.HotModuleReplacementPlugin(), new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(), // new webpack.NamedModulesPlugin(),
]), ]),
// new CleanWebpackPlugin(), // new CleanWebpackPlugin(),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({

View file

@ -53,27 +53,24 @@
"cpy-cli": "^3.1.1", "cpy-cli": "^3.1.1",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"css-loader": "^4.3.0", "css-loader": "^4.3.0",
"css-minimizer-webpack-plugin": "^1.3.0",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"html-webpack-plugin": "^4.5.1", "html-webpack-plugin": "^5.3.1",
"less": "^3.13.1", "less": "^3.13.1",
"less-loader": "^6.2.0", "less-loader": "^6.2.0",
"mini-css-extract-plugin": "^0.9.0", "mini-css-extract-plugin": "^1.3.9",
"mobx": "^6.1.8", "mobx": "^6.1.8",
"mobx-react": "^7.1.0", "mobx-react": "^7.1.0",
"optimize-css-assets-webpack-plugin": "^5.0.4",
"ora": "^4.1.1", "ora": "^4.1.1",
"postcss-loader": "^3.0.0", "postcss-loader": "^3.0.0",
"postcss-preset-env": "^6.7.0", "postcss-preset-env": "^6.7.0",
"react-redux": "^7.2.2",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"style-loader": "^1.3.0", "style-loader": "^1.3.0",
"terser-webpack-plugin": "^3.1.0", "terser-webpack-plugin": "^3.1.0",
"url-loader": "^4.1.1", "url-loader": "^4.1.1",
"webpack": "^4.46.0", "webpack": "^5.26.3",
"webpack-cli": "^3.3.12", "webpack-cli": "^4.5.0",
"webpack-dev-server": "^3.11.2", "webpack-dev-server": "^3.11.2",
"workbox-webpack-plugin": "^5.1.4" "workbox-webpack-plugin": "^6.1.2"
} }
} }