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 OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const CompressionPlugin = require('compression-webpack-plugin') const CompressionPlugin = require('compression-webpack-plugin')
const ManifestPlugin = require('webpack-manifest-plugin') const ManifestPlugin = require('webpack-manifest-plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin') const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const browserConfig = { const browserConfig = {
mode: 'production', mode: 'production',
@ -35,9 +35,10 @@ const browserConfig = {
{ {
loader: 'css-loader', loader: 'css-loader',
options: { options: {
modules: true, modules: {
importLoaders: 2, localIdentName: '[name]__[local]___[hash:base64:5]'
localIdentName: '[name]__[local]___[hash:base64:5]' },
importLoaders: 2
} }
}, },
{ {
@ -67,7 +68,7 @@ const browserConfig = {
plugins: [ plugins: [
new ManifestPlugin(), new ManifestPlugin(),
new webpack.DefinePlugin({ __isBrowser__: 'true' }), new webpack.DefinePlugin({ __isBrowser__: 'true' }),
new CleanWebpackPlugin(['public/static', 'build'], {}), new CleanWebpackPlugin(),
new MiniCssExtractPlugin({ filename: '[name].[contenthash].css' }), new MiniCssExtractPlugin({ filename: '[name].[contenthash].css' }),
new CompressionPlugin({}) new CompressionPlugin({})
], ],

View File

@ -3,6 +3,7 @@ const webpack = require('webpack')
const nodeExternals = require('webpack-node-externals') const nodeExternals = require('webpack-node-externals')
const MiniCssExtractPlugin = require('mini-css-extract-plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const CreateFileWebpack = require('create-file-webpack') const CreateFileWebpack = require('create-file-webpack')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const serverConfig = { const serverConfig = {
entry: './src/server.js', entry: './src/server.js',
@ -25,14 +26,14 @@ const serverConfig = {
{ {
test: /\.scss$/, test: /\.scss$/,
use: [ use: [
MiniCssExtractPlugin.loader,
{ {
loader: 'css-loader', loader: 'css-loader',
options: { options: {
modules: true, modules: {
exportOnlyLocals: true, localIdentName: '[name]__[local]___[hash:base64:5]'
importLoaders: 2, },
localIdentName: '[name]__[local]___[hash:base64:5]' onlyLocals: true,
importLoaders: 2
} }
}, },
{ {
@ -58,6 +59,7 @@ const serverConfig = {
__isBrowser__: 'false' __isBrowser__: 'false'
}), }),
new MiniCssExtractPlugin(), new MiniCssExtractPlugin(),
new CleanWebpackPlugin(),
new CreateFileWebpack({ new CreateFileWebpack({
path: './src/utils/', path: './src/utils/',
fileName: 'data.json', fileName: 'data.json',