-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
66 lines (65 loc) · 1.85 KB
/
webpack.config.js
File metadata and controls
66 lines (65 loc) · 1.85 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const path = require('path');
module.exports = {
mode: 'development',
entry: {
main: './src/client/js/main.js',
navigation: './src/client/js/ui/navigation.js'
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'public/js'),
clean: false, // Don't clean the entire directory to preserve other files
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
]
},
resolve: {
extensions: ['.js'],
fallback: {
// Monaco editor modules use AMD loading
'vs/editor/editor.main': false
}
},
externals: {
// Treat Monaco as external since it's loaded via CDN
'monaco-editor': 'monaco',
// Exclude Node.js native modules
'ffi-napi': 'commonjs ffi-napi',
'ref-napi': 'commonjs ref-napi',
'fs': 'commonjs fs',
'path': 'commonjs path',
'os': 'commonjs os',
'crypto': 'commonjs crypto',
'stream': 'commonjs stream',
'buffer': 'commonjs buffer',
'events': 'commonjs events',
'util': 'commonjs util',
'http': 'commonjs http',
'https': 'commonjs https',
'url': 'commonjs url',
'querystring': 'commonjs querystring',
'zlib': 'commonjs zlib',
'net': 'commonjs net',
'tls': 'commonjs tls',
'dgram': 'commonjs dgram'
},
devtool: 'source-map', // Generate source maps for debugging
stats: {
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}
};