encryptme/webpack.config.js
dogeystamp cff32999ba
major refactor
- moved everything to webpack
2023-01-30 18:40:09 -05:00

41 lines
712 B
JavaScript

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const pages = ["index", "aes"];
module.exports = {
mode: 'development',
entry: pages.reduce((config, page) => {
config[page] = `./src/${page}.js`;
return config;
}, {}),
output: {
filename: "[name].js",
path: path.resolve(__dirname, "dist"),
},
optimization: {
splitChunks: {
chunks: "all",
},
},
plugins: [].concat(
pages.map(
(page) =>
new HtmlWebpackPlugin({
inject: true,
template: `./src/pages/${page}.html`,
filename: `${page}.html`,
chunks: [page],
})
)
),
module: {
rules: [
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
],
},
};