-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
35 lines (34 loc) · 1.01 KB
/
webpack.config.js
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
33
34
35
// webpack.config.js
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: './src/index.js', // Your main JavaScript file
output: {
path: path.resolve(__dirname, 'public'),
filename: 'bundle.js', // Output bundled file
},
resolve: {
fallback: {
buffer: require.resolve('buffer/'),
url: require.resolve('url/'),
util: require.resolve('util/'),
path: require.resolve('path-browserify'),
stream: require.resolve('stream-browserify'),
zlib: require.resolve('browserify-zlib'),
assert: require.resolve('assert/'),
// Add other Node.js core modules here as needed
},
},
plugins: [
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
mode: 'development',
devtool: 'source-map',
devServer: {
static: path.resolve(__dirname, 'public'),
port: 8080,
open: true,
},
};