Adding in sweeping changes

This commit is contained in:
Frank Delaguila
2022-03-13 14:01:09 -06:00
parent 7227705ac6
commit 8845c79c35
9 changed files with 81 additions and 45 deletions

View File

@@ -1,6 +1,7 @@
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCSSExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
// let htmlPageNames = [];
// let multipleHtmlPlugins = htmlPageNames.map(name => {
@@ -59,8 +60,11 @@ module.exports = {
// Images
{
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset',
test: /\.(png|svg|jpg|jpeg|gif|mp4)$/i,
type: 'asset/resource',
generator: {
filename: 'assets/[name].[ext]'
},
},
// {
@@ -107,10 +111,14 @@ module.exports = {
],
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
template: path.resolve(__dirname, './src/views/index.html'),
inject: 'body',
}),
new MiniCSSExtractPlugin({
filename: 'css/[name].[contenthash].css',
}),
],
optimization: {
moduleIds: 'deterministic',