{"action":"created","issue":{"url":"https://api.github.com/repos/code-chunks/angular2-logger/issues/49","repository_url":"https://api.github.com/repos/code-chunks/angular2-logger","labels_url":"https://api.github.com/repos/code-chunks/angular2-logger/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/code-chunks/angular2-logger/issues/49/comments","events_url":"https://api.github.com/repos/code-chunks/angular2-logger/issues/49/events","html_url":"https://github.com/code-chunks/angular2-logger/issues/49","id":160775621,"number":49,"title":"Error importing angular2-logger in Webpack vendor bundle","user":{"login":"andreimaximov","id":8564325,"avatar_url":"https://avatars.githubusercontent.com/u/8564325?v=3","gravatar_id":"","url":"https://api.github.com/users/andreimaximov","html_url":"https://github.com/andreimaximov","followers_url":"https://api.github.com/users/andreimaximov/followers","following_url":"https://api.github.com/users/andreimaximov/following{/other_user}","gists_url":"https://api.github.com/users/andreimaximov/gists{/gist_id}","starred_url":"https://api.github.com/users/andreimaximov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreimaximov/subscriptions","organizations_url":"https://api.github.com/users/andreimaximov/orgs","repos_url":"https://api.github.com/users/andreimaximov/repos","events_url":"https://api.github.com/users/andreimaximov/events{/privacy}","received_events_url":"https://api.github.com/users/andreimaximov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-06-16T22:29:26Z","updated_at":"2016-06-16T23:45:45Z","closed_at":null,"body":"I'm using Webpack to build my project and I have a separate `vendor.ts` file where I import all third party modules to build a separate `vendor.bundle.js` file.\r\n\r\n`angular2-logger` is having trouble with the `import 'module'` import format. The following are my `vendor.ts` files and the Webpack build error message.\r\n\r\n**vendor.ts**\r\n```ts\r\nimport '@angular/core';\r\nimport '@angular/platform-browser-dynamic';\r\nimport '@angular/http';\r\nimport 'angular2-logger/core'; // This causes an issue...\r\nimport * as ng2log from 'angular2-logger/core';  // But this works...\r\nimport 'material-design-lite/material';\r\n\r\nrequire('material-design-lite/material.css');\r\n```\r\n\r\n**Error**\r\n```\r\nERROR in ./~/angular2-logger/core.ts\r\nModule build failed: Error: Unknown file /Users/amaximov/Documents/Projects/collegevend-angular2-client/node_modules/angular2-logger/core.ts\r\n    at State.fastEmit (/Users/amaximov/Documents/Projects/collegevend-angular2-client/node_modules/awesome-typescript-loader/dist.babel/host.js:300:23)\r\n    at transform (/Users/amaximov/Documents/Projects/collegevend-angular2-client/node_modules/awesome-typescript-loader/dist.babel/index.js:215:53)\r\n    at _callee3$ (/Users/amaximov/Documents/Projects/collegevend-angular2-client/node_modules/awesome-typescript-loader/dist.babel/index.js:265:42)\r\n    at tryCatch (/Users/amaximov/Documents/Projects/collegevend-angular2-client/node_modules/awesome-typescript-loader/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:62:40)\r\n    at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/amaximov/Documents/Projects/collegevend-angular2-client/node_modules/awesome-typescript-loader/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:336:22)\r\n    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/amaximov/Documents/Projects/collegevend-angular2-client/node_modules/awesome-typescript-loader/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:95:21)\r\n    at fulfilled (/Users/amaximov/Documents/Projects/collegevend-angular2-client/node_modules/awesome-typescript-loader/dist.babel/index.js:31:32)\r\n    at run (/Users/amaximov/Documents/Projects/collegevend-angular2-client/node_modules/core-js/modules/es6.promise.js:89:22)\r\n    at /Users/amaximov/Documents/Projects/collegevend-angular2-client/node_modules/core-js/modules/es6.promise.js:102:28\r\n    at flush (/Users/amaximov/Documents/Projects/collegevend-angular2-client/node_modules/core-js/modules/_microtask.js:18:9)\r\n    at nextTickCallbackWith0Args (node.js:420:9)\r\n    at process._tickCallback (node.js:349:13)\r\n @ ./src/boot/vendor.ts 5:0-31\r\n```\r\n\r\nAm I missing something obvious or is this a bug?"},"comment":{"url":"https://api.github.com/repos/code-chunks/angular2-logger/issues/comments/226645292","html_url":"https://github.com/code-chunks/angular2-logger/issues/49#issuecomment-226645292","issue_url":"https://api.github.com/repos/code-chunks/angular2-logger/issues/49","id":226645292,"user":{"login":"andreimaximov","id":8564325,"avatar_url":"https://avatars.githubusercontent.com/u/8564325?v=3","gravatar_id":"","url":"https://api.github.com/users/andreimaximov","html_url":"https://github.com/andreimaximov","followers_url":"https://api.github.com/users/andreimaximov/followers","following_url":"https://api.github.com/users/andreimaximov/following{/other_user}","gists_url":"https://api.github.com/users/andreimaximov/gists{/gist_id}","starred_url":"https://api.github.com/users/andreimaximov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreimaximov/subscriptions","organizations_url":"https://api.github.com/users/andreimaximov/orgs","repos_url":"https://api.github.com/users/andreimaximov/repos","events_url":"https://api.github.com/users/andreimaximov/events{/privacy}","received_events_url":"https://api.github.com/users/andreimaximov/received_events","type":"User","site_admin":false},"created_at":"2016-06-16T23:45:45Z","updated_at":"2016-06-16T23:45:45Z","body":"The idea is that I have three separate bundles that power my app:\r\n\r\n1. polyfills (`core-js/es6`, `core-js/es7/reflect`, etc.)\r\n2. vendor (`@angular2/*`, `ng2-mdl`, etc.)\r\n3. main (Code for my app)\r\n\r\nThe two main benefits of this are...\r\n\r\n1. Polyfills and vendor rarely change so browser can just cache those files even if my app code changes as long as I'm not using any new libraries (Doesn't matter for development but beneficial in production)\r\n\r\n2. I'm also new to webpack, but I believe it speeds up the build during auto-reload because it only has to rebuild my app code and can ignore the vendor/libs which do not change.\r\n\r\nBecause of this I'm simply dumping `import 'angular2-logger/core'` into my `vendor.ts` to include it in the vendor bundle. I use `import {Logger} from 'angular2-logger/core'` in places I'm using the logger, but Webpack puts the compiled JS into a separate vendor/libs bundle from my application code.\r\n\r\nTo me this is the cleanest (No unused variable linter warnings) and most convenient syntax which is why I went with that approach. Either way, I can use the `import * as ng2log from 'angular2-logger/core';` workaround.\r\n\r\nJust though I'd share this issue since it is [valid TypeScript module syntax](https://www.typescriptlang.org/docs/handbook/modules.html).\r\n"}}
{"actor":{"display_login":"andreimaximov"}}