I am currently utilizing the angular2-webpack starter from GitHub, and I am looking to incorporate an npm library, such as Babylon JS. My approach so far has been as follows:
import * as BABYLON from 'babylonjs/babylon';
The Babylon library includes a d.ts
file, which I have placed at the beginning of my code like this:
/// <reference path="../../../node_modules/babylonjs/babylon.d.ts" />
However, even though I am able to utilize the library, Visual Studio Code indicates an error stating that
Exported external package typings file 'node_modules/babylonjs/babylon.d.ts' is not a module.
. This prevents me from using the auto-completion features provided by the typings. Since I am new to webpack, it is unclear to me if there are any specific configurations that need to be set. Currently, I am using the default configuration provided with the starter pack.
Can someone confirm if this is the correct method for importing an external library? Additionally, could you advise on what further configurations I may need to implement in order to resolve this error and enable auto-completion functionality?