grid/webpack.config.js

39 lines
1.1 KiB
JavaScript
Raw Normal View History

const path = require('path');
2023-01-09 23:13:06 +00:00
const HtmlWebpackPlugin = require('html-webpack-plugin');
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'),
}),
],
output: {
2023-01-09 23:13:06 +00:00
clean: true,
filename: '[name].bundle.js',
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
],
},
};