webpack-config-demo/webpack.config.js

24 lines
452 B
JavaScript
Raw Normal View History

2024-10-04 11:44:01 +03:00
const path = require('node:path');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/dist/',
assetModuleFilename: 'images/[hash][ext][query]'
},
module: {
rules: [
{
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/resource',
},
{
test: /\.txt$/i,
type: 'asset/source',
}
],
},
};