'use strict'; // eslint-disable-line
console.log('Webpack v5 Upgrade');
const path = require('path');
const webpack = require('webpack');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const ESLintWebpackPlugin = require('eslint-webpack-plugin');
const miniCssExtractPlugin = require('mini-css-extract-plugin');
const config = require('./config');
const isUnderDevelopment = true;
let webpackConfig = {
mode: 'development',
context: path.resolve(__dirname, '../'),
// devtool: isUnderDevelopment ? 'inline-source-map' : '',
entry: [
'./scripts/main.js',
'./styles/main.scss',
'./styles/check.css',
],
output: {
path: path.resolve(__dirname, '../../dist'),
filename: '[name].bundle.min.js'
},
module: {
rules: [
{
enforce: 'pre',
test: /\.s?[ca]ss$/,
use: [
miniCssExtractPlugin.loader,
'css-loader',
'sass-loader'
]
},
{
test: /\.(ttf|otf|eot|woff2?|png|jpe?g|gif|svg|ico)$/,
type: 'asset/resource',
},
],
},
plugins: [
new CleanWebpackPlugin(),
new miniCssExtractPlugin({ filename: '[name].whirehouse.css'}),
],
};
module.exports = webpackConfig;