Files
examples-for-kids/webpack.config.js
vigdorov b49ee9c524
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Deploy to pages / build (push) Has been cancelled
migrate to ci-templates
2026-02-08 11:47:23 +03:00

46 lines
1.2 KiB
JavaScript

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
const {CleanWebpackPlugin} = require('clean-webpack-plugin');
module.exports = {
entry: './src/script.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
},
devServer: {
open: true,
},
module: {
rules: [
{
test: /\.css$/i,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
},
{
test: /\.(png|jpe?g|gif)$/i,
use: [
{
loader: 'file-loader',
},
],
},
],
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
template: './public/index.html',
filename: 'index.html',
favicon: './public/favicon.ico',
}),
new MiniCssExtractPlugin(),
new FaviconsWebpackPlugin({
logo: './public/icon-512x512.png',
manifest: './public/manifest.json',
}),
],
};