fateriddle Posted January 22, 2019 Share Posted January 22, 2019 I tried @babylonjs/core 4.0.0 import { Scene, Engine, FreeCamera, Vector3, HemisphericLight, Mesh, } from '@babylonjs/core' ... It doesn't seem to do proper tree shaking as the build bundle still includes everything(tried webpack-bundle-analyzer), and the size is still 2.11m. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted January 22, 2019 Share Posted January 22, 2019 The forum as moved here : https://forum.babylonjs.com/t/welcome-to-the-new-babylon-js-forum/18 you should post there for any questions. Regarding yours, the side effects not being filled in the package.json (currently under dev) you need to import from individual modules: import { Engine } from "@babylonjs/core/Engines/engine"; import { Scene } from "@babylonjs/core/scene"; import { Vector3 } from "@babylonjs/core/Maths/math"; import { FreeCamera } from "@babylonjs/core/Cameras/freeCamera"; import { HemisphericLight } from "@babylonjs/core/Lights/hemisphericLight"; import { Mesh } from "@babylonjs/core/Meshes/mesh"; // Side effect import to fill in the default material on scene and Mesh.CreateBox functions import "@babylonjs/core/Materials/standardMaterial"; import "@babylonjs/core/Meshes/Builders/boxBuilder"; This is all detailed in the package doc: https://www.npmjs.com/package/@babylonjs/core/v/4.0.0-alpha.21 https://doc.babylonjs.com/features/es6_support#tree-shaking Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.