2024-01-10 00:30:16 -05:00
|
|
|
const path = require("path");
|
|
|
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
2024-01-08 23:12:32 -05:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: {
|
2024-01-10 00:30:16 -05:00
|
|
|
index: "./src/index.js",
|
2024-01-08 23:12:32 -05:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({
|
2024-01-10 00:30:16 -05:00
|
|
|
title: "Javascript Examples",
|
2024-01-08 23:12:32 -05:00
|
|
|
}),
|
|
|
|
],
|
|
|
|
output: {
|
2024-01-10 00:30:16 -05:00
|
|
|
filename: "bundle.js",
|
|
|
|
path: path.resolve(__dirname, "dist"),
|
2024-01-08 23:12:32 -05:00
|
|
|
clean: true,
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.css$/i,
|
2024-01-10 00:30:16 -05:00
|
|
|
use: ["style-loader", "css-loader"],
|
2024-01-08 23:12:32 -05:00
|
|
|
},
|
|
|
|
{
|
2024-01-10 00:30:16 -05:00
|
|
|
test: /\.(png|svg|jpg|jpeg|gif)$/i,
|
|
|
|
type: "asset/resource",
|
2024-01-08 23:12:32 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(woff|woff2|eot|ttf|otf)$/i,
|
2024-01-10 00:30:16 -05:00
|
|
|
type: "asset/resource",
|
2024-01-08 23:12:32 -05:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
};
|