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