The size difference is totally normal cause mesh builder imports basically all the builders not just the box.
About your issue, the main difference is that there are 2 different APIs due to legacy support the former:
/**
* Creates a box mesh. Please consider using the same method from the MeshBuilder class instead
* @param name defines the name of the mesh to create
* @param size sets the size (float) of each box side (default 1)
* @param scene defines the hosting scene
* @param updatable defines if the mesh must be flagged as updatable
* @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
* @returns a new Mesh
*/
public static CreateBox(name: string, size: number, scene: Nullable<Scene> = null, updatable?: boolean, sideOrientation?: number): Mesh
which takes size as a parameter not as an option option object.
the newer with more options:
/**
* Creates a box mesh
* * The parameter `size` sets the size (float) of each box side (default 1)
* * You can set some different box dimensions by using the parameters `width`, `height` and `depth` (all by default have the same value of `size`)
* * You can set different colors and different images to each box side by using the parameters `faceColors` (an array of 6 Color3 elements) and `faceUV` (an array of 6 Vector4 elements)
* * Please read this tutorial : https://doc.babylonjs.com/how_to/createbox_per_face_textures_and_colors
* * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
* * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
* @see https://doc.babylonjs.com/how_to/set_shapes#box
* @param name defines the name of the mesh
* @param options defines the options used to create the mesh
* @param scene defines the hosting scene
* @returns the box mesh
*/
public static CreateBox(name: string, options: { size?: number, width?: number, height?: number, depth?: number, faceUV?: Vector4[], faceColors?: Color4[], sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4, wrap?: boolean, topBaseAt?: number, bottomBaseAt?: number , updatable?: boolean}, scene: Nullable<Scene> = null): Mesh
which takes the options as an object
The newer version is available on MeshBuilder and BoxBuilder
So you could:
import { BoxBuilder } "@babylonjs/core/Meshes/Builders/boxBuilder";
and then:
const box = BoxBuilder.CreateBox("Box", { size: 3 }, scene);
This way you benefit from extended options and granular tree shaking.