{"action":"created","issue":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/9562","repository_url":"https://api.github.com/repos/mrdoob/three.js","labels_url":"https://api.github.com/repos/mrdoob/three.js/issues/9562/labels{/name}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/9562/comments","events_url":"https://api.github.com/repos/mrdoob/three.js/issues/9562/events","html_url":"https://github.com/mrdoob/three.js/issues/9562","id":172552141,"number":9562,"title":"Transform `examples/js` to support modules","user":{"login":"kdex","id":4442505,"avatar_url":"https://avatars.githubusercontent.com/u/4442505?v=3","gravatar_id":"","url":"https://api.github.com/users/kdex","html_url":"https://github.com/kdex","followers_url":"https://api.github.com/users/kdex/followers","following_url":"https://api.github.com/users/kdex/following{/other_user}","gists_url":"https://api.github.com/users/kdex/gists{/gist_id}","starred_url":"https://api.github.com/users/kdex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdex/subscriptions","organizations_url":"https://api.github.com/users/kdex/orgs","repos_url":"https://api.github.com/users/kdex/repos","events_url":"https://api.github.com/users/kdex/events{/privacy}","received_events_url":"https://api.github.com/users/kdex/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":59,"created_at":"2016-08-22T20:53:42Z","updated_at":"2016-11-20T00:00:19Z","closed_at":null,"body":"The main source code has recently been ported to ES2015 modules (see #9310); however, some parts are still relying on global namespace pollution and have thus become unusable.\n\nSpecifically the things in `/examples/js/` haven't been transformed to support modules yet; this makes them currently unusable from within environments such as webpack or SystemJS.\n"},"comment":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/261748359","html_url":"https://github.com/mrdoob/three.js/issues/9562#issuecomment-261748359","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/9562","id":261748359,"user":{"login":"kdex","id":4442505,"avatar_url":"https://avatars.githubusercontent.com/u/4442505?v=3","gravatar_id":"","url":"https://api.github.com/users/kdex","html_url":"https://github.com/kdex","followers_url":"https://api.github.com/users/kdex/followers","following_url":"https://api.github.com/users/kdex/following{/other_user}","gists_url":"https://api.github.com/users/kdex/gists{/gist_id}","starred_url":"https://api.github.com/users/kdex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdex/subscriptions","organizations_url":"https://api.github.com/users/kdex/orgs","repos_url":"https://api.github.com/users/kdex/repos","events_url":"https://api.github.com/users/kdex/events{/privacy}","received_events_url":"https://api.github.com/users/kdex/received_events","type":"User","site_admin":false},"created_at":"2016-11-20T00:00:19Z","updated_at":"2016-11-20T00:00:19Z","body":"@backspaces Sorry, I don't understand what you're trying to achieve.\r\n\r\nIf you use Webpack, just import the examples by setting up the imports-loader plugin. If you use SystemJS, follow the link I posted in my last post directed at you; you can link modules to globals there, too.\r\n\r\nYou **don't** need any `<script>` tags for three.js-related stuff, **nor** do you need to modify the source in order to use them as ES2015 modules. All of the steps needed have been discussed or pointed to already. It's just a matter of (painful) configuration, but that's the way the transition is carried out at the moment, until better solutions allow us to re-write the examples in ES2015. (And one of the obvious solutions would be `<script type=\"module\">`.)\r\n\r\nYou don't need to touch any of this project's files nor introduce globals in the browser."}}
{"actor":{"display_login":"kdex"}}