Make it work again

This commit is contained in:
LordMathis 2019-09-22 20:01:43 +02:00
parent c28927a029
commit cee4b6a56f
No known key found for this signature in database
GPG Key ID: 575849FD91CE470C
2 changed files with 13 additions and 10 deletions

View File

@ -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({})
],

View File

@ -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',