{"action":"created","comment":{"url":"https://api.github.com/repos/angular/angular-cli/pulls/comments/74648127","id":74648127,"diff_hunk":"@@ -49,23 +66,47 @@ export function getWebpackCommonConfig(projectRoot: string, sourceDir: string) {\n           ],\n           exclude: [/\\.(spec|e2e)\\.ts$/]\n         },\n-        { test: /\\.json$/, loader: 'json-loader'},\n-        { test: /\\.css$/,  loaders: ['raw-loader', 'postcss-loader'] },\n-        { test: /\\.styl$/, loaders: ['raw-loader', 'postcss-loader', 'stylus-loader'] },\n-        { test: /\\.less$/, loaders: ['raw-loader', 'postcss-loader', 'less-loader'] },\n-        { test: /\\.scss$|\\.sass$/, loaders: ['raw-loader', 'postcss-loader', 'sass-loader'] },\n-        { test: /\\.(jpg|png)$/, loader: 'url-loader?limit=128000'},\n-        { test: /\\.html$/, loader: 'raw-loader' }\n+\n+        // in main, load css as raw text\n+        { exclude: additionalFiles, test: /\\.css$/, loaders: ['raw-loader', 'postcss-loader'] },\n+        { exclude: additionalFiles, test: /\\.styl$/, loaders: ['raw-loader', 'postcss-loader', 'stylus-loader'] },\n+        { exclude: additionalFiles, test: /\\.less$/, loaders: ['raw-loader', 'postcss-loader', 'less-loader'] },\n+        { exclude: additionalFiles, test: /\\.scss$|\\.sass$/, loaders: ['raw-loader', 'postcss-loader', 'sass-loader'] },\n+\n+        // outside of main, load it via style-loader\n+        { include: additionalFiles, test: /\\.css$/, loaders: ['style-loader', 'css-loader', 'postcss-loader'] },\n+        { include: additionalFiles, test: /\\.styl$/, loaders: ['style-loader', 'css-loader', 'postcss-loader', 'stylus-loader'] },\n+        { include: additionalFiles, test: /\\.less$/, loaders: ['style-loader', 'css-loader', 'postcss-loader', 'less-loader'] },\n+        { include: additionalFiles, test: /\\.scss$|\\.sass$/, loaders: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'] },","path":"addon/ng2/models/webpack-build-common.ts","position":87,"original_position":87,"commit_id":"ee59a8461a3afc2206647951a2496204075d6d08","original_commit_id":"ee59a8461a3afc2206647951a2496204075d6d08","user":{"login":"clydin","id":19598772,"avatar_url":"https://avatars.githubusercontent.com/u/19598772?v=3","gravatar_id":"","url":"https://api.github.com/users/clydin","html_url":"https://github.com/clydin","followers_url":"https://api.github.com/users/clydin/followers","following_url":"https://api.github.com/users/clydin/following{/other_user}","gists_url":"https://api.github.com/users/clydin/gists{/gist_id}","starred_url":"https://api.github.com/users/clydin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clydin/subscriptions","organizations_url":"https://api.github.com/users/clydin/orgs","repos_url":"https://api.github.com/users/clydin/repos","events_url":"https://api.github.com/users/clydin/events{/privacy}","received_events_url":"https://api.github.com/users/clydin/received_events","type":"User","site_admin":false},"body":"Was `ExtractTextPlugin` considered instead of embedding the styles in the bundles?  It has the advantage of not requiring the entire (and potentially large) bundle to be downloaded and executed before the styles are applied. `HtmlWebpackPlugin` supports automatically adding the extracted stylesheet links to `index.html`.","created_at":"2016-08-12T19:30:12Z","updated_at":"2016-08-12T19:30:12Z","html_url":"https://github.com/angular/angular-cli/pull/1633#discussion_r74648127","pull_request_url":"https://api.github.com/repos/angular/angular-cli/pulls/1633","_links":{"self":{"href":"https://api.github.com/repos/angular/angular-cli/pulls/comments/74648127"},"html":{"href":"https://github.com/angular/angular-cli/pull/1633#discussion_r74648127"},"pull_request":{"href":"https://api.github.com/repos/angular/angular-cli/pulls/1633"}}},"pull_request":{"url":"https://api.github.com/repos/angular/angular-cli/pulls/1633","id":80902845,"html_url":"https://github.com/angular/angular-cli/pull/1633","diff_url":"https://github.com/angular/angular-cli/pull/1633.diff","patch_url":"https://github.com/angular/angular-cli/pull/1633.patch","issue_url":"https://api.github.com/repos/angular/angular-cli/issues/1633","number":1633,"state":"open","locked":false,"title":"feat(build): update angular-cli.json","user":{"login":"filipesilva","id":4172079,"avatar_url":"https://avatars.githubusercontent.com/u/4172079?v=3","gravatar_id":"","url":"https://api.github.com/users/filipesilva","html_url":"https://github.com/filipesilva","followers_url":"https://api.github.com/users/filipesilva/followers","following_url":"https://api.github.com/users/filipesilva/following{/other_user}","gists_url":"https://api.github.com/users/filipesilva/gists{/gist_id}","starred_url":"https://api.github.com/users/filipesilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipesilva/subscriptions","organizations_url":"https://api.github.com/users/filipesilva/orgs","repos_url":"https://api.github.com/users/filipesilva/repos","events_url":"https://api.github.com/users/filipesilva/events{/privacy}","received_events_url":"https://api.github.com/users/filipesilva/received_events","type":"User","site_admin":false},"body":"TODO:\r\n- [ ] move prefix\r\n- [ ] clarify comments in polyfill\r\n\r\nThis PR replaces some hardcoded values in the build system by values specified in `angular-cli.json`. It also adds the `additionalEntries` property that allows users to add more files to their build.\r\n\r\nThe `apps` entry in `angular-cli` config looks like this now:\r\n```\r\n  \"apps\": [\r\n    {\r\n      \"root\": \"src\",\r\n      \"outDir\": \"dist\",\r\n      \"assets\": \"assets\",\r\n      \"index\": \"index.html\",\r\n      \"main\": \"main.ts\",\r\n      \"test\": \"test.ts\",\r\n      \"tsconfig\": \"tsconfig.json\",\r\n      \"mobile\": false,\r\n      \"additionalEntries\": [\r\n        { \"input\": \"polyfills.ts\", \"output\": \"polyfills.js\" },\r\n        \"scripts.ts\",\r\n        \"styles.css\"\r\n      ],\r\n      \"environments\": {\r\n        \"source\": \"environments/environment.ts\",\r\n        \"prod\": \"environments/environment.prod.ts\",\r\n        \"dev\": \"environments/environment.dev.ts\"\r\n      }\r\n    }\r\n  ],\r\n```\r\nPlease note two breaking changes:\r\n- `apps[0].root` replaces the previous `defaults.sourceDir`.\r\n- `apps[0].assets` directory replaces the previous `public` folder in the project root as a folder whose contents are copied over without processing.\r\n\r\nA description of the `additionalEntries` functionality is below, as shown in `README.md`\r\n\r\n===\r\n\r\n### Adding extra files to the build\r\n\r\nThe `apps[0].additionalEntries` array in `angular-cli.json` allows a user to add more files to the build.\r\n\r\nThe `additionalEntries` array supports two kinds of entries, with different behaviours.\r\n- strings will be bundled together with the `main` bundle\r\n- objects with `input` and `output` properties will create a new bundle which is loaded before the `main` bundle.\r\n\r\nBy default it looks like this:\r\n\r\n```\r\napps: [\r\n  {\r\n    //...\r\n    \"additionalEntries\": [\r\n      { \"input\": \"polyfills.ts\", \"output\": \"polyfills.js\" },\r\n      \"scripts.ts\",\r\n      \"styles.css\"\r\n    ],\r\n  }\r\n]\r\n```\r\n\r\nThese entries correspond to the following files in `src/`:\r\n- `polifills.ts` has browser polyfills needed for Angular 2. It will be \r\nbundled separately as `polyfills.js` and loaded before everything else.\r\n- `styles.css` allows users to add global styles and supports \r\n[CSS imports](https://developer.mozilla.org/en/docs/Web/CSS/@import). If the \r\nproject is created with the `--style=sass` option, this will be a `.sass` file \r\ninstead, and the same applies to `scss/less/styl`. It will be part of the main \r\nbundle.\r\n- `scripts.ts` allows users to add global code outside of the Angular 2 app. It\r\nwill also be part of the main bundle.","created_at":"2016-08-11T04:28:29Z","updated_at":"2016-08-12T19:30:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5364547d42324ec245585998469e12275e84e255","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/angular/angular-cli/pulls/1633/commits","review_comments_url":"https://api.github.com/repos/angular/angular-cli/pulls/1633/comments","review_comment_url":"https://api.github.com/repos/angular/angular-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/angular-cli/issues/1633/comments","statuses_url":"https://api.github.com/repos/angular/angular-cli/statuses/ee59a8461a3afc2206647951a2496204075d6d08","head":{"label":"filipesilva:additional-entries","ref":"additional-entries","sha":"ee59a8461a3afc2206647951a2496204075d6d08","user":{"login":"filipesilva","id":4172079,"avatar_url":"https://avatars.githubusercontent.com/u/4172079?v=3","gravatar_id":"","url":"https://api.github.com/users/filipesilva","html_url":"https://github.com/filipesilva","followers_url":"https://api.github.com/users/filipesilva/followers","following_url":"https://api.github.com/users/filipesilva/following{/other_user}","gists_url":"https://api.github.com/users/filipesilva/gists{/gist_id}","starred_url":"https://api.github.com/users/filipesilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipesilva/subscriptions","organizations_url":"https://api.github.com/users/filipesilva/orgs","repos_url":"https://api.github.com/users/filipesilva/repos","events_url":"https://api.github.com/users/filipesilva/events{/privacy}","received_events_url":"https://api.github.com/users/filipesilva/received_events","type":"User","site_admin":false},"repo":{"id":46974063,"name":"angular-cli","full_name":"filipesilva/angular-cli","owner":{"login":"filipesilva","id":4172079,"avatar_url":"https://avatars.githubusercontent.com/u/4172079?v=3","gravatar_id":"","url":"https://api.github.com/users/filipesilva","html_url":"https://github.com/filipesilva","followers_url":"https://api.github.com/users/filipesilva/followers","following_url":"https://api.github.com/users/filipesilva/following{/other_user}","gists_url":"https://api.github.com/users/filipesilva/gists{/gist_id}","starred_url":"https://api.github.com/users/filipesilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipesilva/subscriptions","organizations_url":"https://api.github.com/users/filipesilva/orgs","repos_url":"https://api.github.com/users/filipesilva/repos","events_url":"https://api.github.com/users/filipesilva/events{/privacy}","received_events_url":"https://api.github.com/users/filipesilva/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/filipesilva/angular-cli","description":"","fork":true,"url":"https://api.github.com/repos/filipesilva/angular-cli","forks_url":"https://api.github.com/repos/filipesilva/angular-cli/forks","keys_url":"https://api.github.com/repos/filipesilva/angular-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/filipesilva/angular-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/filipesilva/angular-cli/teams","hooks_url":"https://api.github.com/repos/filipesilva/angular-cli/hooks","issue_events_url":"https://api.github.com/repos/filipesilva/angular-cli/issues/events{/number}","events_url":"https://api.github.com/repos/filipesilva/angular-cli/events","assignees_url":"https://api.github.com/repos/filipesilva/angular-cli/assignees{/user}","branches_url":"https://api.github.com/repos/filipesilva/angular-cli/branches{/branch}","tags_url":"https://api.github.com/repos/filipesilva/angular-cli/tags","blobs_url":"https://api.github.com/repos/filipesilva/angular-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/filipesilva/angular-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/filipesilva/angular-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/filipesilva/angular-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/filipesilva/angular-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/filipesilva/angular-cli/languages","stargazers_url":"https://api.github.com/repos/filipesilva/angular-cli/stargazers","contributors_url":"https://api.github.com/repos/filipesilva/angular-cli/contributors","subscribers_url":"https://api.github.com/repos/filipesilva/angular-cli/subscribers","subscription_url":"https://api.github.com/repos/filipesilva/angular-cli/subscription","commits_url":"https://api.github.com/repos/filipesilva/angular-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/filipesilva/angular-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/filipesilva/angular-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/filipesilva/angular-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/filipesilva/angular-cli/contents/{+path}","compare_url":"https://api.github.com/repos/filipesilva/angular-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/filipesilva/angular-cli/merges","archive_url":"https://api.github.com/repos/filipesilva/angular-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/filipesilva/angular-cli/downloads","issues_url":"https://api.github.com/repos/filipesilva/angular-cli/issues{/number}","pulls_url":"https://api.github.com/repos/filipesilva/angular-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/filipesilva/angular-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/filipesilva/angular-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/filipesilva/angular-cli/labels{/name}","releases_url":"https://api.github.com/repos/filipesilva/angular-cli/releases{/id}","deployments_url":"https://api.github.com/repos/filipesilva/angular-cli/deployments","created_at":"2015-11-27T10:21:58Z","updated_at":"2016-08-10T23:43:26Z","pushed_at":"2016-08-12T18:22:09Z","git_url":"git://github.com/filipesilva/angular-cli.git","ssh_url":"git@github.com:filipesilva/angular-cli.git","clone_url":"https://github.com/filipesilva/angular-cli.git","svn_url":"https://github.com/filipesilva/angular-cli","homepage":null,"size":1163,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"fc0a82e29516ec173ed31b3d2230e05523edb94b","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":36891867,"name":"angular-cli","full_name":"angular/angular-cli","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/angular-cli","description":"CLI tool for Angular2","fork":false,"url":"https://api.github.com/repos/angular/angular-cli","forks_url":"https://api.github.com/repos/angular/angular-cli/forks","keys_url":"https://api.github.com/repos/angular/angular-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/angular-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/angular-cli/teams","hooks_url":"https://api.github.com/repos/angular/angular-cli/hooks","issue_events_url":"https://api.github.com/repos/angular/angular-cli/issues/events{/number}","events_url":"https://api.github.com/repos/angular/angular-cli/events","assignees_url":"https://api.github.com/repos/angular/angular-cli/assignees{/user}","branches_url":"https://api.github.com/repos/angular/angular-cli/branches{/branch}","tags_url":"https://api.github.com/repos/angular/angular-cli/tags","blobs_url":"https://api.github.com/repos/angular/angular-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/angular-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/angular-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/angular-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/angular-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/angular-cli/languages","stargazers_url":"https://api.github.com/repos/angular/angular-cli/stargazers","contributors_url":"https://api.github.com/repos/angular/angular-cli/contributors","subscribers_url":"https://api.github.com/repos/angular/angular-cli/subscribers","subscription_url":"https://api.github.com/repos/angular/angular-cli/subscription","commits_url":"https://api.github.com/repos/angular/angular-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/angular-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/angular-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/angular-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/angular-cli/contents/{+path}","compare_url":"https://api.github.com/repos/angular/angular-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/angular-cli/merges","archive_url":"https://api.github.com/repos/angular/angular-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/angular-cli/downloads","issues_url":"https://api.github.com/repos/angular/angular-cli/issues{/number}","pulls_url":"https://api.github.com/repos/angular/angular-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/angular-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/angular-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/angular-cli/labels{/name}","releases_url":"https://api.github.com/repos/angular/angular-cli/releases{/id}","deployments_url":"https://api.github.com/repos/angular/angular-cli/deployments","created_at":"2015-06-04T19:49:37Z","updated_at":"2016-08-12T19:07:19Z","pushed_at":"2016-08-12T19:26:48Z","git_url":"git://github.com/angular/angular-cli.git","ssh_url":"git@github.com:angular/angular-cli.git","clone_url":"https://github.com/angular/angular-cli.git","svn_url":"https://github.com/angular/angular-cli","homepage":"","size":2848,"stargazers_count":2969,"watchers_count":2969,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":428,"mirror_url":null,"open_issues_count":205,"forks":428,"open_issues":205,"watchers":2969,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular-cli/pulls/1633"},"html":{"href":"https://github.com/angular/angular-cli/pull/1633"},"issue":{"href":"https://api.github.com/repos/angular/angular-cli/issues/1633"},"comments":{"href":"https://api.github.com/repos/angular/angular-cli/issues/1633/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular-cli/pulls/1633/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/angular-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/angular-cli/pulls/1633/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular-cli/statuses/ee59a8461a3afc2206647951a2496204075d6d08"}}}}
{"actor":{"display_login":"clydin"}}