I guess it is because you use babylon instead of babylonjs in your require dependencies.
As you can try with this sample, it all works as expected:
function runBabylon(OIMO, BABYLON) {
// Get the canvas
const canvas = document.getElementById("renderCanvas");
// This creates a basic Babylon Engine
var engine = new BABYLON.Engine(canvas);
// This creates a basic Babylon Scene object (non-mesh)
var scene = new BABYLON.Scene(engine);
// This creates and positions a free camera (non-mesh)
var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene);
// This targets the camera to scene origin
camera.setTarget(BABYLON.Vector3.Zero());
// This attaches the camera to the canvas
camera.attachControl(canvas, true);
// This creates a light, aiming 0,1,0 - to the sky (non-mesh)
var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene);
// Default intensity is 1. Let's dim the light a small amount
light.intensity = 0.7;
// Our built-in 'sphere' shape. Params: name, subdivs, size, scene
var sphere = BABYLON.Mesh.CreateSphere("sphere1", 16, 2, scene);
// Move the sphere upward 1/2 its height
sphere.position.y = 2;
// Our built-in 'ground' shape. Params: name, width, depth, subdivs, scene
var ground = BABYLON.Mesh.CreateGround("ground1", 6, 6, 2, scene);
scene.enablePhysics(new BABYLON.Vector3(0, -9, 0), new BABYLON.OimoJSPlugin(undefined, OIMO));
sphere.physicsImpostor = new BABYLON.PhysicsImpostor(sphere, BABYLON.PhysicsImpostor.SphereImpostor, { mass: 1, restitution: 0.9 }, scene);
ground.physicsImpostor = new BABYLON.PhysicsImpostor(ground, BABYLON.PhysicsImpostor.BoxImpostor, { mass: 0, restitution: 0.9 }, scene);
engine.runRenderLoop(() => {
scene.render();
});
}
//The requirejs config
requirejs.config({
baseUrl: '.',
paths: {
babylonjs: 'https://preview.babylonjs.com/babylon.max',
oimo: 'https://preview.babylonjs.com/oimo',
pep: 'https://code.jquery.com/pep/0.4.3/pep'
},
shim : {
babylonjs: {deps: ['pep']}
}
});
require(['pep', 'oimo', 'babylonjs'], function(_, OIMO, BABYLON) {
runBabylon(OIMO, BABYLON);
});
replacing babylonjs by babylon fails cause using the defined name is important here.