Skip to content

Commit de1f3d8

Browse files
committed
build(webpack.config):updated 'three' aliases to fix building errors
1 parent 94d5d50 commit de1f3d8

File tree

1 file changed

+11
-3
lines changed
  • packages/splunk-3D-graph-network-topology-viz/appserver/static/visualizations/3d_graph_network_topology_viz

1 file changed

+11
-3
lines changed

packages/splunk-3D-graph-network-topology-viz/appserver/static/visualizations/3d_graph_network_topology_viz/webpack.config.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,18 @@ module.exports = {
99
filename: path.join(__dirname, 'src') + '/visualization_source.js'
1010
},
1111
resolve: {
12-
// To avoid [WARNING: Multiple instances of Three.js being imported.]
12+
// To avoid:
13+
// - [WARNING: Multiple instances of Three.js being imported.],
14+
// - [Field 'browser' doesn't contain a valid alias configuration
15+
// /appserver/static/visualizations/3d_graph_network_topology_viz/node_modules/three/webgpu.js doesn't exist]
1316
alias: {
14-
three: path.resolve(__dirname, 'node_modules/three')
15-
},
17+
// Ensure 'three/webgpu' is an exact match and points to the correct build file.
18+
// -> The '$' makes it an exact match for 'three/webgpu'.
19+
'three/webgpu$': path.resolve(__dirname, 'node_modules/three/build/three.webgpu.js'),
20+
// Ensure general 'three' imports also point to the module entry point.
21+
// This helps avoid conflicts if other dependencies import 'three' directly.
22+
'three$': path.resolve(__dirname, 'node_modules/three/build/three.module.js'),
23+
}
1624
},
1725
performance: {
1826
hints: false

0 commit comments

Comments
 (0)