webpack-config-demo/webpack.config.js
Primakov Alexandr Alexandrovich 7eb2fb7326 lesson-02 base setup
2024-10-04 11:44:01 +03:00

24 lines
452 B
JavaScript

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',
}
],
},
};