Spaces:
Running
Running
| const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
| const path = require('path'); | |
| module.exports = { | |
| entry: './src/index.js', | |
| output: { | |
| path: path.resolve(__dirname, 'dist'), | |
| filename: 'bundle.js', | |
| clean: true, | |
| }, | |
| module: { | |
| rules: [ | |
| { | |
| test: /\.css$/i, | |
| use: ['style-loader', 'css-loader'], | |
| }, | |
| { | |
| test: /\.js$/, | |
| exclude: /node_modules/, // Exclude all node_modules from source map processing | |
| use: ["source-map-loader"], | |
| enforce: "pre" | |
| } | |
| ], | |
| }, | |
| plugins: [ | |
| new HtmlWebpackPlugin({ | |
| template: './src/index.html', | |
| }), | |
| ], | |
| resolve: { | |
| extensions: ['.js', '.json', '.css'], | |
| }, | |
| devtool: 'source-map', | |
| }; |