Skip to content

Commit

Permalink
Fixed require
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-moreau committed Jun 30, 2019
1 parent 5e5fab7 commit e4d8f69
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"babylonjs-materials": "./node_modules/babylonjs-materials/babylonjs.materials.min.js",
"babylonjs-procedural-textures": "./node_modules/babylonjs-procedural-textures/babylonjs.proceduralTextures.js",
"babylonjs-post-process": "./node_modules/babylonjs-post-process/babylonjs.postProcess.js",
"babylonjs-loaders": "./node_modules/babylonjs-loaders/babylonjs.loaders.js",
"cannon": "./node_modules/cannon/build/cannon.min.js",
"spectorjs": "./node_modules/spectorjs/dist/spector.bundle.js",
"earcut": "./node_modules/earcut/dist/earcut.min.js",
Expand Down Expand Up @@ -197,6 +198,8 @@
return System.import("babylonjs-materials");
}).then(function () {
return System.import("babylonjs-post-process");
}).then(function () {
return System.import("babylonjs-loaders");
}).then(function () {
return System.import('./build/src/editor/tools/tools.js').then(function (t) {
tools = t.default;
Expand Down
8 changes: 7 additions & 1 deletion src/extensions/tools/require.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import * as BABYLON from 'babylonjs';
import * as POSTPROCESS from 'babylonjs-post-process';
import * as MATERIALS from 'babylonjs-materials';
import * as LOADERS from 'babylonjs-loaders';
import * as PROCEDURALTEXTURES from 'babylonjs-procedural-textures';
import * as GUI from 'babylonjs-gui';
import * as CANNON from 'cannon';
import * as EARCUT from 'earcut';
Expand Down Expand Up @@ -29,10 +32,13 @@ export const editorRequire = (moduleName: string) => {
switch (moduleName) {
// Babylon.js
case 'babylonjs':
return BABYLON;
case 'babylonjs-procedural-textures':
return PROCEDURALTEXTURES;
case 'babylonjs-loaders':
return LOADERS;
case 'babylonjs-materials':
return BABYLON;
return MATERIALS;
case 'babylonjs-post-process':
return POSTPROCESS;
case 'babylonjs-gui':
Expand Down

0 comments on commit e4d8f69

Please sign in to comment.