{"action":"created","issue":{"url":"https://api.github.com/repos/rollup/rollup/issues/1465","repository_url":"https://api.github.com/repos/rollup/rollup","labels_url":"https://api.github.com/repos/rollup/rollup/issues/1465/labels{/name}","comments_url":"https://api.github.com/repos/rollup/rollup/issues/1465/comments","events_url":"https://api.github.com/repos/rollup/rollup/issues/1465/events","html_url":"https://github.com/rollup/rollup/issues/1465","id":238293305,"number":1465,"title":"Module loader in the browser","user":{"login":"binarykitchen","id":177641,"avatar_url":"https://avatars2.githubusercontent.com/u/177641?v=3","gravatar_id":"","url":"https://api.github.com/users/binarykitchen","html_url":"https://github.com/binarykitchen","followers_url":"https://api.github.com/users/binarykitchen/followers","following_url":"https://api.github.com/users/binarykitchen/following{/other_user}","gists_url":"https://api.github.com/users/binarykitchen/gists{/gist_id}","starred_url":"https://api.github.com/users/binarykitchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binarykitchen/subscriptions","organizations_url":"https://api.github.com/users/binarykitchen/orgs","repos_url":"https://api.github.com/users/binarykitchen/repos","events_url":"https://api.github.com/users/binarykitchen/events{/privacy}","received_events_url":"https://api.github.com/users/binarykitchen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-24T04:14:55Z","updated_at":"2017-06-25T01:59:39Z","closed_at":null,"body":"Is there a recipe how to solve the following?\r\n\r\n```html\r\n<html>\r\n    <body>\r\n        <script src=\"/dist/i-have-been-bundled-with-rollup-and-my-module-name-is-videomail-client.js\"></script>\r\n        <script>\r\n            import VideomailClient from 'videomail-client' // <--- boooom\r\n        </script>\r\n    </body>\r\n</html>\r\n```\r\n\r\nBefore I were using `require` instead in conjunction with Browserify. But now migrating to Rollup, cannot use `var VideomailClient = require('videomail-client')` anymore.\r\n\r\nWhat's the solution here? Thanks for any tips!"},"comment":{"url":"https://api.github.com/repos/rollup/rollup/issues/comments/310876869","html_url":"https://github.com/rollup/rollup/issues/1465#issuecomment-310876869","issue_url":"https://api.github.com/repos/rollup/rollup/issues/1465","id":310876869,"user":{"login":"bfred-it","id":1402241,"avatar_url":"https://avatars0.githubusercontent.com/u/1402241?v=3","gravatar_id":"","url":"https://api.github.com/users/bfred-it","html_url":"https://github.com/bfred-it","followers_url":"https://api.github.com/users/bfred-it/followers","following_url":"https://api.github.com/users/bfred-it/following{/other_user}","gists_url":"https://api.github.com/users/bfred-it/gists{/gist_id}","starred_url":"https://api.github.com/users/bfred-it/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfred-it/subscriptions","organizations_url":"https://api.github.com/users/bfred-it/orgs","repos_url":"https://api.github.com/users/bfred-it/repos","events_url":"https://api.github.com/users/bfred-it/events{/privacy}","received_events_url":"https://api.github.com/users/bfred-it/received_events","type":"User","site_admin":false},"created_at":"2017-06-25T01:59:39Z","updated_at":"2017-06-25T01:59:39Z","body":"It is a bad practice, that's why many now use bundlers and not plain `script` tags 😃 \r\n\r\nI think the trick would be to output a UMD bundle. It looks for a `module` or `export` globals, so if you set them before loading your umd bundle you can build your own loader.\r\n\r\nOtherwise either you stick to browserify for the `require` bundle or use ES modules with some polyfill/loader. I think I've seen some article about that. I wouldn't suggest either. Bundling and real ES modules are the standard. "}}
{"actor":{"display_login":"bfred-it"}}