{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/builder/issues/395","labels_url":"https://api.github.com/repos/systemjs/builder/issues/395/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/builder/issues/395/comments","events_url":"https://api.github.com/repos/systemjs/builder/issues/395/events","html_url":"https://github.com/systemjs/builder/issues/395","id":116192796,"number":395,"title":"Basic bundling issue (a.k.a - I don't think I'm fully understanding this)","user":{"login":"mcavanagh","id":6319592,"avatar_url":"https://avatars.githubusercontent.com/u/6319592?v=3","gravatar_id":"","url":"https://api.github.com/users/mcavanagh","html_url":"https://github.com/mcavanagh","followers_url":"https://api.github.com/users/mcavanagh/followers","following_url":"https://api.github.com/users/mcavanagh/following{/other_user}","gists_url":"https://api.github.com/users/mcavanagh/gists{/gist_id}","starred_url":"https://api.github.com/users/mcavanagh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcavanagh/subscriptions","organizations_url":"https://api.github.com/users/mcavanagh/orgs","repos_url":"https://api.github.com/users/mcavanagh/repos","events_url":"https://api.github.com/users/mcavanagh/events{/privacy}","received_events_url":"https://api.github.com/users/mcavanagh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-10T20:17:26Z","updated_at":"2015-11-11T09:15:12Z","closed_at":null,"body":"Apologies if I'm being really stupid, but I'm trying to get a basic 1-file bundle working, and having all kinds of pain.\r\n\r\n### File structure\r\n\r\n```\r\n/Ts\r\n    /main.ts\r\n    /SgfParser.ts\r\n    /StringReader.ts\r\n```\r\n\r\nmain.ts imports angular2 and my own class, _SgfParser_\r\n\r\nI'm compiling these typescript files into individual .js files in the same directory, with the following **tsconfig.json**:\r\n\r\n```\r\n{\r\n  \"compilerOptions\": {\r\n    \"target\": \"es5\",\r\n    \"module\": \"system\",\r\n    \"sourceMap\": true,\r\n    \"emitDecoratorMetadata\": true,\r\n    \"experimentalDecorators\": true,\r\n    \"removeComments\": false,\r\n    \"noImplicitAny\": true,\r\n    \"noEmitOnError\": true\r\n  }\r\n}\r\n```\r\n\r\nThe first line of the compiled .js is as follows:\r\n\r\n**main.js**\r\n```\r\nSystem.register([\"angular2/angular2\", \"SgfParser\"], function(exports_1) {\r\n...\r\n```\r\n\r\nIn my **gulpfile.js**, I'm then using systemjs-builder as per the sample code to try and create a one-file bundle:\r\n\r\n```javascript\r\ngulp.task('bundle', function() {\r\n    var builder = new Builder(\".\");\r\n\r\n    builder.config({\r\n        meta: { 'angular2/angular2': { build: false } }\r\n    });\r\n\r\n    builder\r\n        .bundle('main', '../wwwroot/js/app.js')\r\n        .then(function() {\r\n            console.log('Build complete');\r\n        })\r\n        .catch(function(err) {\r\n            console.log('Build error');\r\n            console.log(err);\r\n        });\r\n});\r\n```\r\n\r\nRunning this task results in \r\n```\r\n[Error: ENOENT, open 'D:\\Code\\Visual Studio Projects\\SgfClient\\src\\SgfClient\\Ts\\main']\r\n```\r\n\r\nThis is the correct path, except for the missing '.js' on the end. Is there some config setting in systemjs-builder where you tell it to assume a file extension of '.js' (like when you use System.config in the browser), or is that not the issue?  If I change this line:\r\n\r\n```\r\n.bundle('main', '../wwwroot/js/app.js')\r\n```\r\n\r\nto \r\n\r\n```\r\n.bundle('main.js', '../wwwroot/js/app.js')\r\n```\r\n it finds the main.js file, but then proceeds to throw a similar error trying to find 'SgfParser' (this is what makes me assume it's a file path issue rather than a module name issue.  I've had a lot of confusion determining where systemjs is referring to paths vs names).  However, I also suspect that this isn't the fix, because I read another issue where you said that the first argument to bundle() is a module name, not a path.\r\n\r\nAt this point I'm fairly lost.  Any pointers welcome.\r\n"},"comment":{"url":"https://api.github.com/repos/systemjs/builder/issues/comments/155711158","html_url":"https://github.com/systemjs/builder/issues/395#issuecomment-155711158","issue_url":"https://api.github.com/repos/systemjs/builder/issues/395","id":155711158,"user":{"login":"mcavanagh","id":6319592,"avatar_url":"https://avatars.githubusercontent.com/u/6319592?v=3","gravatar_id":"","url":"https://api.github.com/users/mcavanagh","html_url":"https://github.com/mcavanagh","followers_url":"https://api.github.com/users/mcavanagh/followers","following_url":"https://api.github.com/users/mcavanagh/following{/other_user}","gists_url":"https://api.github.com/users/mcavanagh/gists{/gist_id}","starred_url":"https://api.github.com/users/mcavanagh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcavanagh/subscriptions","organizations_url":"https://api.github.com/users/mcavanagh/orgs","repos_url":"https://api.github.com/users/mcavanagh/repos","events_url":"https://api.github.com/users/mcavanagh/events{/privacy}","received_events_url":"https://api.github.com/users/mcavanagh/received_events","type":"User","site_admin":false},"created_at":"2015-11-11T09:15:12Z","updated_at":"2015-11-11T09:15:12Z","body":"Thanks, I'll give that a try.  "}}