Import path @babylonjs/core

Hi, is there a difference between:
import { Color4 } from "@babylonjs/core/Maths/math.color";
and
import { Color4 } from "@babylonjs/core"; ?

1 Like

Hey,

The former is better in terms of treeshaking (smaller bundle size, faster IDE suggestions).

But personally I use the latter as I haven’t noticed any problems myself.

2 Likes

I think another difference along with tree shaking benefits is missing side-effects. Read more here:

3 Likes

Thank you for both of your answers :white_check_mark:

2 Likes