updated wepack config file syntax
This commit is contained in:
@@ -1,2 +1,3 @@
|
|||||||
client/dist/
|
client/dist/
|
||||||
node_modules/
|
node_modules/
|
||||||
|
webpack.config.js
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const HtmlWebPackPlugin = require('html-webpack-plugin');
|
const HtmlWebPackPlugin = require('html-webpack-plugin');
|
||||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||||
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||||
const dotenv = require('dotenv');
|
const dotenv = require('dotenv');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
@@ -42,7 +42,7 @@ module.exports = () => {
|
|||||||
{
|
{
|
||||||
test: /\.css$/,
|
test: /\.css$/,
|
||||||
include: /node_modules/,
|
include: /node_modules/,
|
||||||
loaders: ['style-loader', 'css-loader'],
|
use: ['style-loader', 'css-loader'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.scss$/,
|
test: /\.scss$/,
|
||||||
@@ -76,7 +76,7 @@ module.exports = () => {
|
|||||||
historyApiFallback: true,
|
historyApiFallback: true,
|
||||||
},
|
},
|
||||||
node: {
|
node: {
|
||||||
fs: 'empty',
|
global: true,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin(envKeys),
|
new webpack.DefinePlugin(envKeys),
|
||||||
@@ -84,15 +84,23 @@ module.exports = () => {
|
|||||||
template: './src/index.html',
|
template: './src/index.html',
|
||||||
filename: './index.html',
|
filename: './index.html',
|
||||||
}),
|
}),
|
||||||
new CopyWebpackPlugin([
|
// new CopyWebpackPlugin({
|
||||||
{ from: 'src/static/images', to: 'static/images' },
|
// patterns: [[ { from: 'src/static/images', to: 'static/images' }],
|
||||||
]),
|
// }),
|
||||||
|
new CopyWebpackPlugin({
|
||||||
|
patterns: [
|
||||||
|
{
|
||||||
|
from: 'src/static/images',
|
||||||
|
to: 'static/images',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}),
|
||||||
new MiniCssExtractPlugin({
|
new MiniCssExtractPlugin({
|
||||||
// Options similar to the same options in webpackOptions.output
|
// Options similar to the same options in webpackOptions.output
|
||||||
// both options are optional
|
// both options are optional
|
||||||
filename: 'main.css',
|
filename: 'main.css',
|
||||||
}),
|
}),
|
||||||
new CleanWebpackPlugin(['dist']),
|
new CleanWebpackPlugin(),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user