odin-codespace/restaurant/app/webpack.config.js

41 lines
908 B
JavaScript
Raw Normal View History

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
2023-12-20 12:25:51 -05:00
mode: 'production',
entry: {
index: './src/index.js',
},
plugins: [
new HtmlWebpackPlugin({
title: 'Restaurant - Dev',
}),
],
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
clean: true,
},
devtool: 'inline-source-map',
devServer: {
static: './dist',
},
module: {
rules: [
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
{
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/resource',
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/i,
type: 'asset/resource',
},
],
},
};