From 35f64a58f8b0b8a990c353f7fb0ba3f339a2c4c2 Mon Sep 17 00:00:00 2001 From: andres alcocer Date: Wed, 6 Oct 2021 13:33:22 -0400 Subject: [PATCH] updated wepack config file syntax --- .eslintignore | 3 ++- webpack.config.js | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.eslintignore b/.eslintignore index a895ccd..e391487 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,3 @@ client/dist/ -node_modules/ \ No newline at end of file +node_modules/ +webpack.config.js diff --git a/webpack.config.js b/webpack.config.js index c2489e3..867f160 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,7 @@ const HtmlWebPackPlugin = require('html-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-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 webpack = require('webpack'); var path = require('path'); @@ -42,7 +42,7 @@ module.exports = () => { { test: /\.css$/, include: /node_modules/, - loaders: ['style-loader', 'css-loader'], + use: ['style-loader', 'css-loader'], }, { test: /\.scss$/, @@ -76,7 +76,7 @@ module.exports = () => { historyApiFallback: true, }, node: { - fs: 'empty', + global: true, }, plugins: [ new webpack.DefinePlugin(envKeys), @@ -84,15 +84,23 @@ module.exports = () => { template: './src/index.html', filename: './index.html', }), - new CopyWebpackPlugin([ - { from: 'src/static/images', to: 'static/images' }, - ]), + // new CopyWebpackPlugin({ + // patterns: [[ { from: 'src/static/images', to: 'static/images' }], + // }), + new CopyWebpackPlugin({ + patterns: [ + { + from: 'src/static/images', + to: 'static/images', + }, + ], + }), new MiniCssExtractPlugin({ // Options similar to the same options in webpackOptions.output // both options are optional filename: 'main.css', }), - new CleanWebpackPlugin(['dist']), + new CleanWebpackPlugin(), ], }; };