odin-codespace/restaurant/webpack.config.js

41 lines
909 B
JavaScript
Raw Permalink Normal View History

2023-12-18 16:19:02 -05:00
const path = require('path');
2023-12-18 17:54:59 -05:00
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: 'development',
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',
},
2023-12-18 20:09:54 -05:00
module: {
rules: [
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
2023-12-20 09:14:18 -05:00
{
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/resource',
2023-12-20 12:07:58 -05:00
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/i,
type: 'asset/resource',
},
2023-12-18 20:09:54 -05:00
],
},
2023-12-18 17:54:59 -05:00
};
2023-12-18 16:19:02 -05:00