2024-02-03 18:56:39 +00:00
|
|
|
const path = require('path');
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: './src/main.js',
|
|
|
|
output: {
|
|
|
|
filename: "bundle.js",
|
|
|
|
clean: true,
|
|
|
|
path: path.resolve(__dirname, "dist"),
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.css$/i,
|
|
|
|
use: ['style-loader', 'css-loader'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(jpg|png|gif|jpeg|webp)$/i,
|
2024-02-03 23:49:09 +00:00
|
|
|
type: "asset/resource",
|
|
|
|
// use: ['file-loader'],
|
2024-02-03 18:56:39 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(woff|woff2|otf|ttf|eot)$/i,
|
|
|
|
type: "asset/resource",
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: "./src/template.html",
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}
|