2023-01-09 22:22:08 +00:00
|
|
|
const path = require('path');
|
2023-01-09 23:13:06 +00:00
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
2023-01-09 22:22:08 +00:00
|
|
|
|
|
|
|
module.exports = {
|
2023-01-09 23:13:06 +00:00
|
|
|
entry: {
|
|
|
|
index: path.resolve(__dirname, 'src', 'index.js'),
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
title: 'Example Webapp',
|
|
|
|
template: path.resolve(__dirname, 'src', 'index.html'),
|
|
|
|
}),
|
|
|
|
],
|
2023-01-09 22:22:08 +00:00
|
|
|
output: {
|
2023-01-09 23:13:06 +00:00
|
|
|
clean: true,
|
|
|
|
filename: '[name].bundle.js',
|
2023-01-09 22:22:08 +00:00
|
|
|
path: path.resolve(__dirname, 'dist'),
|
|
|
|
},
|
2023-01-09 22:35:07 +00:00
|
|
|
module: {
|
|
|
|
rules: [
|
2023-01-09 22:56:10 +00:00
|
|
|
// sass support with `import './styles.scss'`
|
2023-01-09 22:35:07 +00:00
|
|
|
{
|
|
|
|
test: /\.s[ac]ss$/i,
|
|
|
|
use: ['style-loader', 'css-loader', 'sass-loader'],
|
|
|
|
},
|
2023-01-09 22:56:10 +00:00
|
|
|
// css support with `import './styles.css'`
|
|
|
|
{
|
2023-01-09 23:01:06 +00:00
|
|
|
test: /\.css$/i,
|
2023-01-09 22:56:10 +00:00
|
|
|
use: ['style-loader', 'css-loader'],
|
|
|
|
},
|
|
|
|
// image support with `import Image from './image.png'`
|
|
|
|
{
|
|
|
|
test: /\.(png|svg|jpg|jpeg|gif)$/i,
|
|
|
|
type: 'asset/resource',
|
|
|
|
},
|
2023-01-09 22:35:07 +00:00
|
|
|
],
|
|
|
|
},
|
2023-01-09 22:22:08 +00:00
|
|
|
};
|