1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin');
const htmlWebpackPlugin = new HtmlWebpackPlugin({ template: path.resolve(__dirname, '../public/index.html'), });
module.exports = { mode: 'development', entry: path.resolve(__dirname, '../src/index.js'), output: { path: path.resolve(__dirname, '../build'), filename: 'js/[name].[chunkhash:8].bundle.js', }, module: { rules: [ { test: /\.(mjs|js|jsx)$/, exclude: /node_modules/, use: ['babel-loader'], } ], },
plugins: [ htmlWebpackPlugin, ],
resolve: { extensions: ['.mjs', '.js', '.jsx'], }, };
|