Summary:
I am currently attempting to integrate ammo.js physics into an aframe project built with npm and webpack. The reason for needing ammo.js is because cannon.js relies on a deprecated .Geometry component from threejs. This integration must be done through npm as I require access to three-pathfinding, which is only available as an npm package.
Issue:
Upon launching the compiled project, I encounter the following error in the console, leading to non-functional physics:
index.js:1 Uncaught ReferenceError: arguments is not defined
at eval (index.js:1:16)
at Object../node_modules/webworkify/index.js (bundle.js:775:1)
at __webpack_require__ (bundle.js:819:41)
at eval (worker-driver.js:3:18)
at Object../node_modules/@engaging-computing/aframe-physics-system/src/drivers/worker-driver.js (bundle.js:218:1)
at __webpack_require__ (bundle.js:819:41)
at eval (system.js:8:20)
at Object../node_modules/@engaging-computing/aframe-physics-system/src/system.js (bundle.js:238:1)
at __webpack_require__ (bundle.js:819:41)
at eval (index.js:13:1)
Current Configuration:
Package.json
{
"name": "a-frame-min-3",
"version": "1.0.0",
"description": "",
...
webpack.config.js:
const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
...
},
experiments: {
asyncWebAssembly: true
},
node: {
},
resolve:{
fallback: {
fs: false,
path: require.resolve( 'path-browserify' )
}
},
module:{
rules:[
{
test: /\.(wasm)$/,
type: "javascript/auto",
use: {
loader: "file-loader",
options: {
outputPath: "wasm",
name: "[name]-[hash].[ext]"
}
}
]
}
};
index.js:
...
dist/index.html
...