{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/builder/issues/445","labels_url":"https://api.github.com/repos/systemjs/builder/issues/445/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/builder/issues/445/comments","events_url":"https://api.github.com/repos/systemjs/builder/issues/445/events","html_url":"https://github.com/systemjs/builder/issues/445","id":124673844,"number":445,"title":"Using a CDN hosted module instead of downloading it","user":{"login":"delux75","id":4938126,"avatar_url":"https://avatars.githubusercontent.com/u/4938126?v=3","gravatar_id":"","url":"https://api.github.com/users/delux75","html_url":"https://github.com/delux75","followers_url":"https://api.github.com/users/delux75/followers","following_url":"https://api.github.com/users/delux75/following{/other_user}","gists_url":"https://api.github.com/users/delux75/gists{/gist_id}","starred_url":"https://api.github.com/users/delux75/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delux75/subscriptions","organizations_url":"https://api.github.com/users/delux75/orgs","repos_url":"https://api.github.com/users/delux75/repos","events_url":"https://api.github.com/users/delux75/events{/privacy}","received_events_url":"https://api.github.com/users/delux75/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-03T22:12:20Z","updated_at":"2016-01-04T11:05:48Z","closed_at":null,"body":"I'm using a CDN hosted module of jQuery like this:\r\n```javascript\r\nSystem.config({\r\n  baseURL: \"/\",\r\n  defaultJSExtensions: true,\r\n  transpiler: \"babel\",\r\n  babelOptions: {\r\n    \"optional\": [\r\n      \"runtime\",\r\n      \"optimisation.modules.system\"\r\n    ]\r\n  },\r\n  paths: {\r\n    \"github:*\": \"jspm_packages/github/*\",\r\n    \"npm:*\": \"jspm_packages/npm/*\"\r\n  },\r\n\r\n  map: {\r\n    [...]\r\n    \"jquery\": \"https://code.jquery.com/jquery-1.11.3.min.js\",\r\n    [...]\r\n});\r\n\r\n```\r\n\r\nAnd I have several questions about it: \r\n1- Is it a good idea to used a CDN hosted module instead of downloading it from Github / npm?\r\n2- If yes, what is the workflow for production, because so far I have an error when I want to export my code? "},"comment":{"url":"https://api.github.com/repos/systemjs/builder/issues/comments/168647417","html_url":"https://github.com/systemjs/builder/issues/445#issuecomment-168647417","issue_url":"https://api.github.com/repos/systemjs/builder/issues/445","id":168647417,"user":{"login":"gcnm-pgeil","id":11348152,"avatar_url":"https://avatars.githubusercontent.com/u/11348152?v=3","gravatar_id":"","url":"https://api.github.com/users/gcnm-pgeil","html_url":"https://github.com/gcnm-pgeil","followers_url":"https://api.github.com/users/gcnm-pgeil/followers","following_url":"https://api.github.com/users/gcnm-pgeil/following{/other_user}","gists_url":"https://api.github.com/users/gcnm-pgeil/gists{/gist_id}","starred_url":"https://api.github.com/users/gcnm-pgeil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gcnm-pgeil/subscriptions","organizations_url":"https://api.github.com/users/gcnm-pgeil/orgs","repos_url":"https://api.github.com/users/gcnm-pgeil/repos","events_url":"https://api.github.com/users/gcnm-pgeil/events{/privacy}","received_events_url":"https://api.github.com/users/gcnm-pgeil/received_events","type":"User","site_admin":false},"created_at":"2016-01-04T11:05:47Z","updated_at":"2016-01-04T11:05:47Z","body":"1) This depends on what you want to accomplish and whether you want to ship a static bundle file containing all your code (thus not having to load external dependencies during runtime).\r\n2) I wated to do the same and the only way that worked for me was: Building a default bundle (non-static) and having the module 'jquery' being excluded. Therefore your must configure your Builder instance like this:\r\n\r\n```\r\nbuilder.config({\r\n  paths: {\r\n    jquery: 'jquery'\r\n  },\r\n  meta: {\r\n    jquery: { build: false }\r\n  }\r\n});\r\n```\r\nand then define a custom module path for your SystemJS loader instance used during runtime like this: \r\n\r\n```\r\nSystem.config({\r\n  paths: {\r\n    jquery: 'http://code.jquery.com/jquery-2.1.4.min.js',\r\n  }\r\n})\r\n```\r\n\r\n\r\n"}}