Jump to content

Babylon's extensions with NPM imports


Recommended Posts

Hello,
 
 
How can I use Babylon's extensions with NPM imports (es6 style)? 
 
 
To resume my problem:
 
1. I use NPM and Webpack for my project. To use Babylon I've install the node module babylonjs and I import the lib with the line:
import BABYLON from 'babylonjs'

 

2. I would like use too the Sky extension https://doc.babylonjs.com/extensions/sky To do that I try to import it with the line: 
import {skyMaterial} from 'babylonjs/dist/preview release/materialsLibrary/babylon.skyMaterial.min.js'

 

3. The compilation is done but in my Browser I've an error :
Uncaught ReferenceError: __extends is not defined
    at eval (webpack-internal:///36:1)
    at BABYLON (webpack-internal:///36:1)
    at eval (webpack-internal:///36:1)
    at Object.<anonymous> (app.js:951)
    at __webpack_require__ (app.js:660)
    at fn (app.js:86)
    at eval (webpack-internal:///29:7)
    at Object.<anonymous> (app.js:904)
    at __webpack_require__ (app.js:660)
    at fn (app.js:86)

 

I've forgot something or it's the wrong way?
Link to post
Share on other sites

Hi all,

I am currently working on changing the framework's structure. Afterwards, you would be able to use the npm package in order to load / import that parts of the framework you need, or simply import * from babylon.

It will take a bit of time, as I am trying to keep everything backwards compatible while advancing to the future. Please be patient for another week or two.

Link to post
Share on other sites
19 minutes ago, RaananW said:

Hi all,

I am currently working on changing the framework's structure. Afterwards, you would be able to use the npm package in order to load / import that parts of the framework you need, or simply import * from babylon.

It will take a bit of time, as I am trying to keep everything backwards compatible while advancing to the future. Please be patient for another week or two.

Thank you very much @RaananW ,

Do you know a temporary solution like CDN for extensions?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...