From cee4b6a56fa677f2f3ac9ba6a1afa93a7b5b0abb Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sun, 22 Sep 2019 20:01:43 +0200 Subject: [PATCH] Make it work again --- webpack.client.js | 11 ++++++----- webpack.server.js | 12 +++++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/webpack.client.js b/webpack.client.js index dd7d889..64a575c 100644 --- a/webpack.client.js +++ b/webpack.client.js @@ -5,7 +5,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin') const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin') const CompressionPlugin = require('compression-webpack-plugin') const ManifestPlugin = require('webpack-manifest-plugin') -const CleanWebpackPlugin = require('clean-webpack-plugin') +const { CleanWebpackPlugin } = require('clean-webpack-plugin') const browserConfig = { mode: 'production', @@ -35,9 +35,10 @@ const browserConfig = { { loader: 'css-loader', options: { - modules: true, - importLoaders: 2, - localIdentName: '[name]__[local]___[hash:base64:5]' + modules: { + localIdentName: '[name]__[local]___[hash:base64:5]' + }, + importLoaders: 2 } }, { @@ -67,7 +68,7 @@ const browserConfig = { plugins: [ new ManifestPlugin(), new webpack.DefinePlugin({ __isBrowser__: 'true' }), - new CleanWebpackPlugin(['public/static', 'build'], {}), + new CleanWebpackPlugin(), new MiniCssExtractPlugin({ filename: '[name].[contenthash].css' }), new CompressionPlugin({}) ], diff --git a/webpack.server.js b/webpack.server.js index 8242814..e5deaca 100644 --- a/webpack.server.js +++ b/webpack.server.js @@ -3,6 +3,7 @@ const webpack = require('webpack') const nodeExternals = require('webpack-node-externals') const MiniCssExtractPlugin = require('mini-css-extract-plugin') const CreateFileWebpack = require('create-file-webpack') +const { CleanWebpackPlugin } = require('clean-webpack-plugin') const serverConfig = { entry: './src/server.js', @@ -25,14 +26,14 @@ const serverConfig = { { test: /\.scss$/, use: [ - MiniCssExtractPlugin.loader, { loader: 'css-loader', options: { - modules: true, - exportOnlyLocals: true, - importLoaders: 2, - localIdentName: '[name]__[local]___[hash:base64:5]' + modules: { + localIdentName: '[name]__[local]___[hash:base64:5]' + }, + onlyLocals: true, + importLoaders: 2 } }, { @@ -58,6 +59,7 @@ const serverConfig = { __isBrowser__: 'false' }), new MiniCssExtractPlugin(), + new CleanWebpackPlugin(), new CreateFileWebpack({ path: './src/utils/', fileName: 'data.json',