I am creating a game based on this boilerplate from RaananW and node v10.13.0. It uses webpack and supports hotloading ← dont take this to mean I have any idea of what I’m talking about, I just know that
npm start runs
npx webpack serve --config webpack.dev.js.
When I started using the boilerplate, assets loaded fine and hotloading was pretty quick. However, after I refactored scene creation a bit, it takes much longer for the game to load the first time, and hotloading fails with an out-of-memory error roughly 80% of the time.
I’m wondering if any Bablyon JS gurus know what I might be doing wrong. Here is where I load in assets, here is the file where I create the scene, and here is where I start the render loop (called by this bit of code that’s basically from the boilerplate).
And, finally, here is what the startup printout looks like:
(node:20876) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated. BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation. Do changes to assets earlier, e. g. in Compilation.hooks.processAssets. Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*. i ｢wdm｣: assets by path *.glb 219 KiB asset f1be5aa2d46a7f0ee5873282d82afc34.glb 128 KiB [emitted] (auxiliary name: main) asset 4493b64ae5efa5687afd18111a91d836.glb 68.5 KiB [emitted] (auxiliary name: main) asset a9fca8e4f2efa6172032ce70c93fcd52.glb 22.1 KiB [emitted] (auxiliary name: main) asset js/babylonBundle.js 34.4 MiB [emitted] (name: main) asset index.html 617 bytes [emitted] runtime modules 25.4 KiB 12 modules modules by path ./node_modules/@babylonjs/core/ 8.76 MiB 921 modules modules by path ./node_modules/@babylonjs/gui/ 660 KiB 61 modules modules by path ./node_modules/@babylonjs/loaders/glTF/ 349 KiB 38 modules modules by path ./src/ 69.2 KiB 23 modules modules by path ./node_modules/webpack-dev-server/ 21.2 KiB modules by path ./node_modules/webpack-dev-server/client/ 20.9 KiB 10 modules modules by path ./node_modules/webpack-dev-server/node_modules/ 296 bytes 2 modules modules by path ./node_modules/webpack/hot/ 4.46 KiB 5 modules modules by path ./node_modules/html-entities/lib/*.js 61 KiB 5 modules modules by path ./assets/*.glb 2.57 KiB 4 modules modules by path ./node_modules/url/ 37.4 KiB 3 modules modules by path ./node_modules/querystring/*.js 4.51 KiB 3 modules 5 modules webpack 5.13.0 compiled successfully in 108251 ms
and the error