33 lines
814 B
JavaScript
33 lines
814 B
JavaScript
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,
|
|
type: "asset/resource",
|
|
// use: ['file-loader'],
|
|
},
|
|
{
|
|
test: /\.(woff|woff2|otf|ttf|eot)$/i,
|
|
type: "asset/resource",
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new HtmlWebpackPlugin({
|
|
template: "./src/template.html",
|
|
})
|
|
]
|
|
} |