CustomMaterial in babylonjs-materials not recognnized as part of BABYLON namespace

Hello,

I am new to web development, and am trying to attempting to use BJS to create an interactive demo for a 3d pipeline I am working on.
I want to use the CustomMaterial in the babylonjs-materials module, but I am not able to get it work as described in the npm documentation.

my process is:

npm install --save babylonjs babylonjs-materials

and then in a file test.js (I tried test.ts too, same problem)

import * as BABYLON from 'babylonjs';
import 'babylonjs-materials';

BABYLON.CustomMaterial; // <-- Error, BABYLON namespace does not contain 'CustomMaterial'

I did not get a tsconfig file in either node_modules folder, so I am unsure what, if anything I should do with the typescript part.

Thanks for any help with this!

Hi! Welocme to the community!

Follow these steps:

However for a modern app is the ES6 approach more suitable:

https://doc.babylonjs.com/setup/frameworkPackages/es6Support

You can clone this repo: GitHub - RaananW/babylonjs-webpack-es6: Babylon.js basic scene with typescript, webpack, es6 modules, editorconfig, eslint, hot loading and more. Will even make coffee if you ask nicely. and start to code.