text: [{"Owner":"AlbertTJames","Date":"2017-03-28T10:14:49Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tHi_co_ \n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tSince the problem took me over a  week to figure out_co_ here is my solution to bundle your project using web-pack keeping Babylon as a dependency.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tNB_dd_ I am not certain what are the NECESSARY steps (ie what I could simplify) but those are SUFFICIENT steps.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tMy constraints were _dd_\n_lt_/p_gt_\n\n_lt_ol_gt__lt_li_gt_\n\t\tThe final bundle can be imported both in the browser and in node using any kind of import method _dd_ require()_co_ import/export_co_ or &lt_sm_script src_eq_...&gt_sm_ tags\n\t_lt_/li_gt_\n\t_lt_li_gt_\n\t\tIt has to protect against errors in node due to access to window or document that will be undefined\n\t_lt_/li_gt_\n\t_lt_li_gt_\n\t\tBABYLON has to load has a global in the browser using the script tag (window.BABYLON)\n\t_lt_/li_gt_\n\t_lt_li_gt_\n\t\tBABYLON needs to include Canvas2D\n\t_lt_/li_gt_\n\t_lt_li_gt_\n\t\tBABYLON needs to remain external of the bundle so the custom library is light and in theory could load any version of BABYLON\n\t_lt_/li_gt_\n_lt_/ol_gt__lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tSolution to protect loading in node.js_dd_\n_lt_/p_gt_\n\n_lt_ol_gt__lt_li_gt_\n\t\tBuild a custom bundle on Babylon website with Canvas2D ONLY_co_ un-minified_co_ and WITHOUT OIMO OR HANDJS. I did not test all possibilities but since the bundle is a concatenation suppose to be web compatible only_co_ the exports will break in webpack or node in general. But using only this custom version will produce bugs in node due to access to undefined window.\n\t_lt_/li_gt_\n\t_lt_li_gt_\n\t\tThen I had to bundle this custom build using webpack_co_ you can see the configuration of webpack and the builder.js here _dd_ _lt_a href_eq__qt_https_dd_//github.com/albertbuchard/experiment-babylon-js.git_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//github.com/albertbuchard/experiment-babylon-js.git_lt_/a_gt_ The important thing here is how the builder checks for window being defined and the webpack config exporting your named library with UMD.\n\t_lt_/li_gt_\n\t_lt_li_gt_\n\t\tPublish this bundle to NPM (in the github look at the package.json it has three scripts to produce a unminified version_co_ a minified version_co_ and publish the repo on npm)\n\t_lt_/li_gt_\n_lt_/ol_gt__lt_p_gt_\n\tThose two steps will allow to load Babylon using any kind of import method_co_ and do not produce errors in node (but returns an empty object_co_ of course any call to BABYLON function will fail)\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tSolution to keep Babylon as a dependency in your custom library_dd_\n_lt_/p_gt_\n\n_lt_ol_gt__lt_li_gt_\n\t\tIn your library npm install the-custom-babylon-we-just-built\n\t_lt_/li_gt_\n\t_lt_li_gt_\n\t\tImport BABYLON in your scripts any way you want using this custom repo ( es6 import syntax will work &lt_sm_3 ) i.e import BABYLON from _t_the-custom-babylon-we-just-built_t_\n\t_lt_/li_gt_\n\t_lt_li_gt_\n\t\tThen take a look at the webpack config and builder.js of this repo to understand how to manage EXTERNALS_dd_ _lt_a href_eq__qt_https_dd_//github.com/albertbuchard/Experiment.js_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//github.com/albertbuchard/Experiment.js_lt_/a_gt_ \n\t_lt_/li_gt_\n_lt_/ol_gt__lt_p_gt_\n\tThe key element here is how you write your external array_dd_\n_lt_/p_gt_\n\n_lt_pre_gt_\n_lt_code_gt_externals_dd_ {\n    ...\n    lodash_dd_ {\n      commonjs_dd_ _t_lodash_t__co_\n      commonjs2_dd_ _t_lodash_t__co_\n      amd_dd_ _t_lodash_t__co_\n      root_dd_ _t___t__co_\n    }_co_\n    ...\n    _t_experiment-babylon-js_t__dd_ {\n      commonjs_dd_ _t_experiment-babylon-js_t__co_\n      commonjs2_dd_ _t_experiment-babylon-js_t__co_\n      amd_dd_ _t_experiment-babylon-js_t__co_\n      root_dd_ _t_BABYLON_t__co_\n    }_co_\n    ...\n   _t_experiment-babylon-js/lib/babylon.custom.js_t__dd_ {\n      commonjs_dd_ _t_experiment-babylon-js/lib/babylon.custom.js_t__co_\n      commonjs2_dd_ _t_experiment-babylon-js/lib/babylon.custom.js_t__co_\n      amd_dd_ _t_experiment-babylon-js/lib/babylon.custom.js_t__co_\n      root_dd_ _t_BABYLON_t__co_\n    }_co_\n\n\n  }_co__lt_/code_gt__lt_/pre_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tAll but the root (Global environment reference) must be the NAME OF OUR MODULE as you would import it using require(_t_NAME OF YOUR MODULE_t_) so usually the name of your npm folder like the first two exaple_co_ OR the direct path to the file you want to load like the third example.  It has to be the same as the import names you are using in your library. \n_lt_/p_gt_\n\n_lt_p_gt_\n\tSo if you import babylon like so _dd_ \n_lt_/p_gt_\n\n_lt_pre_gt_\n_lt_code_gt_// in your library\nconst BABYLON _eq_ require(_t_./path/to/babylon.js_t_)\n\n\n// in your webpack config\nexternals_dd_ {\n  ...\n  _t_./path/to/babylon.js_t__dd_ {\n    commonjs_dd_ _t_./path/to/babylon.js_t__co_\n    commonjs2_dd_ _t_./path/to/babylon.js_t__co_\n    amd_dd_ _t_./path/to/babylon.js_t__co_\n    root_dd_ _t_BABYLON_t_ \n  }\n  ...\n}_lt_/code_gt__lt_/pre_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tHope it will help some of you ! _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt_ _lt_a contenteditable_eq__qt_false_qt_ data-ipshover_eq__qt__qt_ data-ipshover-target_eq__qt_http_dd_//www.html5gamedevs.com/profile/15986-nikos123/?do_eq_hovercard_qt_ data-mentionid_eq__qt_15986_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/profile/15986-nikos123/_qt_ rel_eq__qt__qt__gt_@Nikos123_lt_/a_gt_\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Deltakosh","Date":"2017-03-28T17:14:56Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tThank you very much I_t_m sure this will be really useful for a lot of people\n_lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Temechon","Date":"2017-03-28T18:58:09Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tYes ! That would be a perfect entry for the doc _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt_ \n_lt_/p_gt_\n\n_lt_p_gt_\n\tDo you want to do it _lt_span_gt__lt_a contenteditable_eq__qt_false_qt_ data-ipshover_eq__qt__qt_ data-ipshover-target_eq__qt_http_dd_//www.html5gamedevs.com/profile/22270-alberttjames/?do_eq_hovercard_qt_ data-mentionid_eq__qt_22270_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/profile/22270-alberttjames/_qt_ rel_eq__qt__qt__gt_@AlbertTJames_lt_/a_gt_ ? Or do you want me to do it and credit you ? Thanks !_lt_/span_gt_\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"AlbertTJames","Date":"2017-03-28T19:40:10Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_blockquote class_eq__qt_ipsQuote_qt_ data-ipsquote_eq__qt__qt_ data-ipsquote-contentapp_eq__qt_forums_qt_ data-ipsquote-contentclass_eq__qt_forums_Topic_qt_ data-ipsquote-contentcommentid_eq__qt_168922_qt_ data-ipsquote-contentid_eq__qt_29365_qt_ data-ipsquote-contenttype_eq__qt_forums_qt_ data-ipsquote-timestamp_eq__qt_1490727489_qt_ data-ipsquote-userid_eq__qt_5218_qt_ data-ipsquote-username_eq__qt_Temechon_qt__gt_\n\t_lt_div class_eq__qt_ipsQuote_citation_qt__gt_\n\t\t44 minutes ago_co_ Temechon said_dd_\n\t_lt_/div_gt_\n\n\t_lt_div class_eq__qt_ipsQuote_contents_qt__gt_\n\t\t_lt_p_gt_\n\t\t\tYes ! That would be a perfect entry for the doc _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt_ \n\t\t_lt_/p_gt_\n\n\t\t_lt_p_gt_\n\t\t\tDo you want to do it _lt_span_gt__lt_a contenteditable_eq__qt_false_qt_ data-ipshover_eq__qt__qt_ data-ipshover-target_eq__qt_http_dd_//www.html5gamedevs.com/profile/22270-alberttjames/?do_eq_hovercard_qt_ data-mentionid_eq__qt_22270_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/profile/22270-alberttjames/_qt_ rel_eq__qt__qt__gt_@AlbertTJames_lt_/a_gt_ ? Or do you want me to do it and credit you ? Thanks !_lt_/span_gt_\n\t\t_lt_/p_gt_\n\t_lt_/div_gt_\n_lt_/blockquote_gt_\n\n_lt_p_gt_\n\tMmmh it is still a bit messy no ? And it does not cover the most frequent use-case of bundling only for frontend.. (with hashed / entry specific bundling etc..)\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI could do it but maybe when I will have a working solution for both use-case ?\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI am working on all the possible use cases these days anyway_co_ I can get back to you when i have explored the question fully \n_lt_/p_gt_\n\n_lt_p_gt_\n\t**BUT** To be totally honest_co_ this technique feels like a hack. The real solution would be to set up the typescript compiler to output an umd compatible module would greatly simplify the whole process. Also protect window / document access to make sure it will not bug in node / server side rendering frameworks. \n_lt_/p_gt_\n\n_lt_p_gt_\n\tI am not very familiar with TS so I dont know how hard it would be_co_ but for the modular future of javascript_co_ it would really help. _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Nikos123","Date":"2017-04-01T09:10:45Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tThanks _lt_a contenteditable_eq__qt_false_qt_ data-ipshover_eq__qt__qt_ data-ipshover-target_eq__qt_http_dd_//www.html5gamedevs.com/profile/22270-alberttjames/?do_eq_hovercard_qt_ data-mentionid_eq__qt_22270_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/profile/22270-alberttjames/_qt_ rel_eq__qt__qt__gt_@AlbertTJames_lt_/a_gt_!\n_lt_/p_gt_\n\n_lt_p_gt_\n\tIts a bit more complex than I need atm!\n_lt_/p_gt_\n\n_lt_p_gt_\n\tOne thing I am looking for is a nice little world-state-sync node server for my RTS game. I will be running animations server side and updating the client from the server. Does anyone know of any good node libs for this_co_ and/or ideally a dockerised container that wraps the basics up?\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Nikos123","Date":"2017-04-01T16:16:42Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tHeres another webpack use case_dd_ \n_lt_/p_gt_\n_lt_iframe data-embedcontent_eq__qt__qt_ frameborder_eq__qt_0_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/topic/29463-how-to-bundle-images-into-textures-using-webpack/?do_eq_embed_qt__gt__lt_/iframe_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"brianzinn","Date":"2017-04-04T05:25:54Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tNice work  @AlbertTJames!\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI have never gotten an import of canvas2d to work - I noticed it was one of your constraints.  Using ES6 imports_co_ I would expect this to work_dd__lt_br /_gt_\n\timport BABYLON from _t_babylonjs_t_ // or import { Mesh } from _t_babylonjs_t__lt_br /_gt_\n\timport _t_babylonjs/2.5/babylon.2.5.canvas2d.max_t__lt_br /_gt__lt_br /_gt_\n\tI would expect the Canvas2D to load with side effects and I have done this with other libraries like d3 (with and without side effects) to import around 10 modules with no issues (using webpack).  I cannot get Canvas2d to import _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt_  When my webpage loads I get _qt_Uncaught BabylonJS is a required dependency_co_ please include it first!_qt_ (I know how to fix that in a standard webpage with script tags). If I use the Babylon.js Generator (_lt_a href_eq__qt_http_dd_//www.babylonjs.com/versionBuilder/_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//www.babylonjs.com/versionBuilder/_lt_/a_gt_) the generated file imports but has runtime errors.  I keep putting off getting canvas2d import working as I give up and when I try again still fail.. eventually I will need to invest some extra time here._lt_br /_gt__lt_br /_gt_\n\tI am doing something completely wrong (which would not surprise me) or I think a change has to come from within the BabylonJS community to make modules easier to work with.  Perhaps something like what d3 did for v4 (_lt_a href_eq__qt_https_dd_//github.com/d3/d3/blob/master/CHANGES.md_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//github.com/d3/d3/blob/master/CHANGES.md_lt_/a_gt_).  They provide a nice list of benefits on their page for having modules/microlibraries written as ES6 modules.\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"AlbertTJames","Date":"2017-04-10T16:18:42Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_blockquote class_eq__qt_ipsQuote_qt_ data-ipsquote_eq__qt__qt_ data-ipsquote-contentapp_eq__qt_forums_qt_ data-ipsquote-contentclass_eq__qt_forums_Topic_qt_ data-ipsquote-contentcommentid_eq__qt_169390_qt_ data-ipsquote-contentid_eq__qt_29365_qt_ data-ipsquote-contenttype_eq__qt_forums_qt_ data-ipsquote-timestamp_eq__qt_1491037845_qt_ data-ipsquote-userid_eq__qt_15986_qt_ data-ipsquote-username_eq__qt_Nikos123_qt__gt_\n\t_lt_div class_eq__qt_ipsQuote_citation_qt__gt_\n\t\tOn 01/04/2017 at 11_dd_10 AM_co_ Nikos123 said_dd_\n\t_lt_/div_gt_\n\n\t_lt_div class_eq__qt_ipsQuote_contents_qt__gt_\n\t\t_lt_p_gt_\n\t\t\tThanks _lt_a contenteditable_eq__qt_false_qt_ data-ipshover_eq__qt__qt_ data-ipshover-target_eq__qt_http_dd_//www.html5gamedevs.com/profile/22270-alberttjames/?do_eq_hovercard_qt_ data-mentionid_eq__qt_22270_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/profile/22270-alberttjames/_qt_ rel_eq__qt__qt__gt_@AlbertTJames_lt_/a_gt_!\n\t\t_lt_/p_gt_\n\n\t\t_lt_p_gt_\n\t\t\tIts a bit more complex than I need atm!\n\t\t_lt_/p_gt_\n\n\t\t_lt_p_gt_\n\t\t\tOne thing I am looking for is a nice little world-state-sync node server for my RTS game. I will be running animations server side and updating the client from the server. Does anyone know of any good node libs for this_co_ and/or ideally a dockerised container that wraps the basics up?\n\t\t_lt_/p_gt_\n\t_lt_/div_gt_\n_lt_/blockquote_gt_\n\n_lt_p_gt_\n\tI think a good framework could be meteor_co_ I have yet to try it with babylon but in theory with subscriptions and minimongo clientside you could achieve a relatively smooth interaction between server and client without too much code. \n_lt_/p_gt_\n\n_lt_p_gt_\n\tIf you do not want meteor_co_ an approach using websockets would be best i think. \n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"AlbertTJames","Date":"2017-04-10T16:28:01Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_blockquote class_eq__qt_ipsQuote_qt_ data-ipsquote_eq__qt__qt_ data-ipsquote-contentapp_eq__qt_forums_qt_ data-ipsquote-contentclass_eq__qt_forums_Topic_qt_ data-ipsquote-contentcommentid_eq__qt_169637_qt_ data-ipsquote-contentid_eq__qt_29365_qt_ data-ipsquote-contenttype_eq__qt_forums_qt_ data-ipsquote-timestamp_eq__qt_1491283554_qt_ data-ipsquote-userid_eq__qt_25365_qt_ data-ipsquote-username_eq__qt_brianzinn_qt__gt_\n\t_lt_div class_eq__qt_ipsQuote_citation_qt__gt_\n\t\tOn 04/04/2017 at 7_dd_25 AM_co_ brianzinn said_dd_\n\t_lt_/div_gt_\n\n\t_lt_div class_eq__qt_ipsQuote_contents_qt__gt_\n\t\t_lt_p_gt_\n\t\t\t I cannot get Canvas2d to import _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt_  When my webpage loads I get _qt_Uncaught BabylonJS is a required dependency_co_ please include it first!_qt_ (I know how to fix that in a standard webpage with script tags). If I use the Babylon.js Generator (_lt_a href_eq__qt_http_dd_//www.babylonjs.com/versionBuilder/_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//www.babylonjs.com/versionBuilder/_lt_/a_gt_) the generated file imports but has runtime errors.  I keep putting off getting canvas2d import working as I give up and when I try again still fail.. eventually I will need to invest some extra time here.\n\t\t_lt_/p_gt_\n\t_lt_/div_gt_\n_lt_/blockquote_gt_\n\n_lt_p_gt_\n\tThe main problem is that the babylon builder concatenates several libraries and if you plan to use module.exports to require or import the libraries it will not work since there are several module.exports _eq_ .. (one for each file you add) \n_lt_/p_gt_\n\n_lt_p_gt_\n\tOne build that works for import is the way I describe_dd_ _lt_span style_eq__qt_color_dd_#272a34_sm__qt__gt_Build a custom bundle on Babylon website with Canvas2D ONLY_co_ un-minified_co_ and WITHOUT OIMO OR HANDJS._lt_/span_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_span style_eq__qt_color_dd_#272a34_sm__qt__gt_BUT this bundle will not work in node since it accesses window objects without testing for environment. That_t_s why I needed to bundle it using a custom webpack config_co_ as well as manually check for window in the builder.js. To make it work clone my github repository_co_ and use the babylon version you want. The bundle produced by this config will work in the browser script tags_co_ in node_co_ and using ES6/CommonJS or any UMD compatible framework (you can use require() or import .. from .. )._lt_/span_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_span style_eq__qt_color_dd_#272a34_sm__qt__gt_ _lt_/span_gt__lt_a href_eq__qt_https_dd_//github.com/albertbuchard/experiment-babylon-js.git_qt_ rel_eq__qt_external nofollow_qt_ style_eq__qt_color_dd_#3c6994_sm__qt__gt_https_dd_//github.com/albertbuchard/experiment-babylon-js.git_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"brianzinn","Date":"2017-04-11T04:57:28Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tI did generate the canvas2D as you described.  The run time error was that the function getInnerPosToRef() was not defined.  I think the RectPackingMap is not inheriting properly from a class in the main babylon js file.  I appreciate your help_co_ but I think I will wait for 3.0_co_ since it sounds like the npm will include Canvas2D.\n_lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Deltakosh","Date":"2017-04-11T15:43:33Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\t3.0 is on npm already as 3.0.0-alpha\n_lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Nikos123","Date":"2017-04-18T08:18:26Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tCool updating to 3.0_co_ hold on to your hats!\n_lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"}]