{"action":"created","issue":{"url":"https://api.github.com/repos/FNNDSC/ami/issues/334","repository_url":"https://api.github.com/repos/FNNDSC/ami","labels_url":"https://api.github.com/repos/FNNDSC/ami/issues/334/labels{/name}","comments_url":"https://api.github.com/repos/FNNDSC/ami/issues/334/comments","events_url":"https://api.github.com/repos/FNNDSC/ami/issues/334/events","html_url":"https://github.com/FNNDSC/ami/issues/334","id":347605282,"node_id":"MDU6SXNzdWUzNDc2MDUyODI=","number":334,"title":"Using AMI as a module (in webpack) no longer works.","user":{"login":"Kingdutch","id":327697,"node_id":"MDQ6VXNlcjMyNzY5Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/327697?v=4","gravatar_id":"","url":"https://api.github.com/users/Kingdutch","html_url":"https://github.com/Kingdutch","followers_url":"https://api.github.com/users/Kingdutch/followers","following_url":"https://api.github.com/users/Kingdutch/following{/other_user}","gists_url":"https://api.github.com/users/Kingdutch/gists{/gist_id}","starred_url":"https://api.github.com/users/Kingdutch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kingdutch/subscriptions","organizations_url":"https://api.github.com/users/Kingdutch/orgs","repos_url":"https://api.github.com/users/Kingdutch/repos","events_url":"https://api.github.com/users/Kingdutch/events{/privacy}","received_events_url":"https://api.github.com/users/Kingdutch/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-08-04T09:42:31Z","updated_at":"2018-09-18T07:36:11Z","closed_at":"2018-09-18T07:36:11Z","author_association":"NONE","body":"### Description\r\n#110 ensured that AMI was build as a CJS module by babel before being published to NPM. This ensured that an `import` properly resolved all dependencies as well.\r\n\r\n#195 Migrated to Webpack which removed this from the build system. \r\n\r\nCurrently AMI only outputs a browser ready bundle which requires a global THREE variable to be present. When using Webpack to bundle the application this means that ThreeJS is not automatically added as dependency and a shim is required. It would be great if we could reinstate the changes made in #110 that were removed in #195 so that THREE is properly imported and detected by webpack.\r\n\r\n#### Live Demo\r\nI do not currently have a live demo of this unfortunately.\r\n\r\n#### Steps to Reproduce\r\n<!--\r\nExample:\r\n\r\n1. Load data XXX\r\n2. Visualize with stack helper\r\n3. Change window level\r\n-->\r\n\r\n1. Set up a basic webpack project (Webpack 4 with no configuration should work). \r\n2. In your main source file use `import * as AMI from 'ami.js'\r\n3. Call `new AMI.OrthographicCamera`\r\n\r\nNote that with the build steps that were introduced in #110 I believe there was no need to use `import * as`.\r\n\r\n\r\n#### Expected Results\r\nThe code works without errors.\r\n\r\n#### Actual Results\r\nThe console shows an error \"THREE not defined\".\r\n\r\n### Browsers Affected\r\n- [x] All\r\n- [ ] Chrome\r\n- [ ] Firefox\r\n- [ ] Edge\r\n- [ ] Safari 9\r\n- [ ] Safari 8\r\n- [ ] IE 11\r\n\r\n### Versions\r\n- AMI: v0.0.22\r\n- THREEJS: v0.94.0\r\n"},"comment":{"url":"https://api.github.com/repos/FNNDSC/ami/issues/comments/422287216","html_url":"https://github.com/FNNDSC/ami/issues/334#issuecomment-422287216","issue_url":"https://api.github.com/repos/FNNDSC/ami/issues/334","id":422287216,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjI4NzIxNg==","user":{"login":"NicolasRannou","id":214063,"node_id":"MDQ6VXNlcjIxNDA2Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/214063?v=4","gravatar_id":"","url":"https://api.github.com/users/NicolasRannou","html_url":"https://github.com/NicolasRannou","followers_url":"https://api.github.com/users/NicolasRannou/followers","following_url":"https://api.github.com/users/NicolasRannou/following{/other_user}","gists_url":"https://api.github.com/users/NicolasRannou/gists{/gist_id}","starred_url":"https://api.github.com/users/NicolasRannou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NicolasRannou/subscriptions","organizations_url":"https://api.github.com/users/NicolasRannou/orgs","repos_url":"https://api.github.com/users/NicolasRannou/repos","events_url":"https://api.github.com/users/NicolasRannou/events{/privacy}","received_events_url":"https://api.github.com/users/NicolasRannou/received_events","type":"User","site_admin":false},"created_at":"2018-09-18T07:36:11Z","updated_at":"2018-09-18T07:36:11Z","author_association":"MEMBER","body":"@Kingdutch you are right, auto-deployement is a different problem!"}}
{"actor":{"display_login":"NicolasRannou"}}