-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
54 lines (50 loc) · 1.15 KB
/
webpack.config.js
File metadata and controls
54 lines (50 loc) · 1.15 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
/**
* Custom Webpack Configuration for LazAI Build Compatibility
*
* This configuration ensures that binary modules from the alith package
* are properly handled during both development and production builds.
*/
module.exports = {
// Handle binary files from native modules
module: {
rules: [
{
test: /\.node$/,
use: 'ignore-loader',
},
],
},
// External modules that should not be bundled
externals: [
'alith',
'alith/lib',
/^@lazai-labs\/alith-.*/,
/^.*\.node$/,
],
// Resolve configuration
resolve: {
fallback: {
// Server-side modules should not be bundled for client
fs: false,
net: false,
dns: false,
tls: false,
http2: false,
'async_hooks': false,
'fs/promises': false,
perf_hooks: false,
// LazAI specific fallbacks
alith: false,
'alith/lib': false,
},
},
// Ignore specific modules during build
plugins: [
new (require('webpack')).IgnorePlugin({
resourceRegExp: /^alith$/,
}),
new (require('webpack')).IgnorePlugin({
resourceRegExp: /^@lazai-labs\/alith-.*/,
}),
],
};