{"action":"created","comment":{"url":"https://api.github.com/repos/postcss/postcss-loader/pulls/comments/78932211","id":78932211,"diff_hunk":"@@ -19,89 +30,141 @@ function PostCSSLoaderError(error) {\n PostCSSLoaderError.prototype = Object.create(Error.prototype);\n PostCSSLoaderError.prototype.constructor = PostCSSLoaderError;\n \n-module.exports = function (source, map) {\n-    if ( this.cacheable ) this.cacheable();\n+function getPluginsFromOptions(options, pack) {\n+    var plugins;\n \n-    var file   = this.resourcePath;\n-    var params = loaderUtils.parseQuery(this.query);\n+    if ( Array.isArray(options) ) {\n+        plugins = options;\n+    } else {\n+        plugins = options.plugins || options.defaults;\n+    }\n \n-    var opts = {\n-        from: file,\n-        to:   file,\n-        map:  {\n-            inline:     params.sourceMap === 'inline',\n-            annotation: false\n+    if ( pack ) {\n+        plugins = options[pack];\n+        if ( !plugins ) {\n+            throw new Error('PostCSS plugin pack is not defined in options');\n         }\n-    };\n+    }\n+\n+    return plugins;\n+}\n+\n+function loadConfigurationFromRc(callback) {\n+    getPostCssRc()\n+      .then(function (config) {\n+          callback(null, { options: config.options, plugins: config.plugins });\n+      })\n+      .catch(function () {\n+          callback(null, { options: {}, plugins: [] });\n+      });\n+}\n \n-    if ( typeof map === 'string' ) map = JSON.parse(map);\n-    if ( map && map.mappings ) opts.map.prev = map;\n+function getConfiguration(options, pack, callback) {\n+    // Read config from separate file or package.json\n+    // only if it's not provided explicitly\n+    if ( typeof options === 'undefined' ) {\n+        if ( pack ) {","path":"index.js","position":67,"original_position":67,"commit_id":"71943ce783ef9f35fd00997807324a6222bca583","original_commit_id":"71943ce783ef9f35fd00997807324a6222bca583","user":{"login":"ertrzyiks","id":2437969,"avatar_url":"https://avatars.githubusercontent.com/u/2437969?v=3","gravatar_id":"","url":"https://api.github.com/users/ertrzyiks","html_url":"https://github.com/ertrzyiks","followers_url":"https://api.github.com/users/ertrzyiks/followers","following_url":"https://api.github.com/users/ertrzyiks/following{/other_user}","gists_url":"https://api.github.com/users/ertrzyiks/gists{/gist_id}","starred_url":"https://api.github.com/users/ertrzyiks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ertrzyiks/subscriptions","organizations_url":"https://api.github.com/users/ertrzyiks/orgs","repos_url":"https://api.github.com/users/ertrzyiks/repos","events_url":"https://api.github.com/users/ertrzyiks/events{/privacy}","received_events_url":"https://api.github.com/users/ertrzyiks/received_events","type":"User","site_admin":false},"body":"Add spec for that","created_at":"2016-09-15T10:23:07Z","updated_at":"2016-09-15T10:24:35Z","html_url":"https://github.com/postcss/postcss-loader/pull/97#discussion_r78932211","pull_request_url":"https://api.github.com/repos/postcss/postcss-loader/pulls/97","_links":{"self":{"href":"https://api.github.com/repos/postcss/postcss-loader/pulls/comments/78932211"},"html":{"href":"https://github.com/postcss/postcss-loader/pull/97#discussion_r78932211"},"pull_request":{"href":"https://api.github.com/repos/postcss/postcss-loader/pulls/97"}}},"pull_request":{"url":"https://api.github.com/repos/postcss/postcss-loader/pulls/97","id":85244546,"html_url":"https://github.com/postcss/postcss-loader/pull/97","diff_url":"https://github.com/postcss/postcss-loader/pull/97.diff","patch_url":"https://github.com/postcss/postcss-loader/pull/97.patch","issue_url":"https://api.github.com/repos/postcss/postcss-loader/issues/97","number":97,"state":"open","locked":false,"title":"Support global config with load config package","user":{"login":"ertrzyiks","id":2437969,"avatar_url":"https://avatars.githubusercontent.com/u/2437969?v=3","gravatar_id":"","url":"https://api.github.com/users/ertrzyiks","html_url":"https://github.com/ertrzyiks","followers_url":"https://api.github.com/users/ertrzyiks/followers","following_url":"https://api.github.com/users/ertrzyiks/following{/other_user}","gists_url":"https://api.github.com/users/ertrzyiks/gists{/gist_id}","starred_url":"https://api.github.com/users/ertrzyiks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ertrzyiks/subscriptions","organizations_url":"https://api.github.com/users/ertrzyiks/orgs","repos_url":"https://api.github.com/users/ertrzyiks/repos","events_url":"https://api.github.com/users/ertrzyiks/events{/privacy}","received_events_url":"https://api.github.com/users/ertrzyiks/received_events","type":"User","site_admin":false},"body":"WORK IN PROGRESS\r\n\r\nIt's going to address #88 , but it may require more attention in the early phase. Any feedback is welcome.","created_at":"2016-09-14T15:00:31Z","updated_at":"2016-09-15T10:24:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"96b611bef398ea5a09688bcd0a84cdde65bc155f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/postcss/postcss-loader/pulls/97/commits","review_comments_url":"https://api.github.com/repos/postcss/postcss-loader/pulls/97/comments","review_comment_url":"https://api.github.com/repos/postcss/postcss-loader/pulls/comments{/number}","comments_url":"https://api.github.com/repos/postcss/postcss-loader/issues/97/comments","statuses_url":"https://api.github.com/repos/postcss/postcss-loader/statuses/71943ce783ef9f35fd00997807324a6222bca583","head":{"label":"ertrzyiks:support-global-config-with-load-config-package","ref":"support-global-config-with-load-config-package","sha":"71943ce783ef9f35fd00997807324a6222bca583","user":{"login":"ertrzyiks","id":2437969,"avatar_url":"https://avatars.githubusercontent.com/u/2437969?v=3","gravatar_id":"","url":"https://api.github.com/users/ertrzyiks","html_url":"https://github.com/ertrzyiks","followers_url":"https://api.github.com/users/ertrzyiks/followers","following_url":"https://api.github.com/users/ertrzyiks/following{/other_user}","gists_url":"https://api.github.com/users/ertrzyiks/gists{/gist_id}","starred_url":"https://api.github.com/users/ertrzyiks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ertrzyiks/subscriptions","organizations_url":"https://api.github.com/users/ertrzyiks/orgs","repos_url":"https://api.github.com/users/ertrzyiks/repos","events_url":"https://api.github.com/users/ertrzyiks/events{/privacy}","received_events_url":"https://api.github.com/users/ertrzyiks/received_events","type":"User","site_admin":false},"repo":{"id":68206746,"name":"postcss-loader","full_name":"ertrzyiks/postcss-loader","owner":{"login":"ertrzyiks","id":2437969,"avatar_url":"https://avatars.githubusercontent.com/u/2437969?v=3","gravatar_id":"","url":"https://api.github.com/users/ertrzyiks","html_url":"https://github.com/ertrzyiks","followers_url":"https://api.github.com/users/ertrzyiks/followers","following_url":"https://api.github.com/users/ertrzyiks/following{/other_user}","gists_url":"https://api.github.com/users/ertrzyiks/gists{/gist_id}","starred_url":"https://api.github.com/users/ertrzyiks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ertrzyiks/subscriptions","organizations_url":"https://api.github.com/users/ertrzyiks/orgs","repos_url":"https://api.github.com/users/ertrzyiks/repos","events_url":"https://api.github.com/users/ertrzyiks/events{/privacy}","received_events_url":"https://api.github.com/users/ertrzyiks/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ertrzyiks/postcss-loader","description":"PostCSS loader for webpack","fork":true,"url":"https://api.github.com/repos/ertrzyiks/postcss-loader","forks_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/forks","keys_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/teams","hooks_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/hooks","issue_events_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/issues/events{/number}","events_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/events","assignees_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/assignees{/user}","branches_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/branches{/branch}","tags_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/tags","blobs_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/git/refs{/sha}","trees_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/statuses/{sha}","languages_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/languages","stargazers_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/stargazers","contributors_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/contributors","subscribers_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/subscribers","subscription_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/subscription","commits_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/commits{/sha}","git_commits_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/git/commits{/sha}","comments_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/comments{/number}","issue_comment_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/issues/comments{/number}","contents_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/contents/{+path}","compare_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/merges","archive_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/downloads","issues_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/issues{/number}","pulls_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/pulls{/number}","milestones_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/milestones{/number}","notifications_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/labels{/name}","releases_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/releases{/id}","deployments_url":"https://api.github.com/repos/ertrzyiks/postcss-loader/deployments","created_at":"2016-09-14T13:01:33Z","updated_at":"2016-09-14T13:01:34Z","pushed_at":"2016-09-15T10:10:11Z","git_url":"git://github.com/ertrzyiks/postcss-loader.git","ssh_url":"git@github.com:ertrzyiks/postcss-loader.git","clone_url":"https://github.com/ertrzyiks/postcss-loader.git","svn_url":"https://github.com/ertrzyiks/postcss-loader","homepage":null,"size":94,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"postcss:master","ref":"master","sha":"d76794802da5ec10d5ee6e30f338ff02d1db6554","user":{"login":"postcss","id":8296347,"avatar_url":"https://avatars.githubusercontent.com/u/8296347?v=3","gravatar_id":"","url":"https://api.github.com/users/postcss","html_url":"https://github.com/postcss","followers_url":"https://api.github.com/users/postcss/followers","following_url":"https://api.github.com/users/postcss/following{/other_user}","gists_url":"https://api.github.com/users/postcss/gists{/gist_id}","starred_url":"https://api.github.com/users/postcss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/postcss/subscriptions","organizations_url":"https://api.github.com/users/postcss/orgs","repos_url":"https://api.github.com/users/postcss/repos","events_url":"https://api.github.com/users/postcss/events{/privacy}","received_events_url":"https://api.github.com/users/postcss/received_events","type":"Organization","site_admin":false},"repo":{"id":24763574,"name":"postcss-loader","full_name":"postcss/postcss-loader","owner":{"login":"postcss","id":8296347,"avatar_url":"https://avatars.githubusercontent.com/u/8296347?v=3","gravatar_id":"","url":"https://api.github.com/users/postcss","html_url":"https://github.com/postcss","followers_url":"https://api.github.com/users/postcss/followers","following_url":"https://api.github.com/users/postcss/following{/other_user}","gists_url":"https://api.github.com/users/postcss/gists{/gist_id}","starred_url":"https://api.github.com/users/postcss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/postcss/subscriptions","organizations_url":"https://api.github.com/users/postcss/orgs","repos_url":"https://api.github.com/users/postcss/repos","events_url":"https://api.github.com/users/postcss/events{/privacy}","received_events_url":"https://api.github.com/users/postcss/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/postcss/postcss-loader","description":"PostCSS loader for webpack","fork":false,"url":"https://api.github.com/repos/postcss/postcss-loader","forks_url":"https://api.github.com/repos/postcss/postcss-loader/forks","keys_url":"https://api.github.com/repos/postcss/postcss-loader/keys{/key_id}","collaborators_url":"https://api.github.com/repos/postcss/postcss-loader/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/postcss/postcss-loader/teams","hooks_url":"https://api.github.com/repos/postcss/postcss-loader/hooks","issue_events_url":"https://api.github.com/repos/postcss/postcss-loader/issues/events{/number}","events_url":"https://api.github.com/repos/postcss/postcss-loader/events","assignees_url":"https://api.github.com/repos/postcss/postcss-loader/assignees{/user}","branches_url":"https://api.github.com/repos/postcss/postcss-loader/branches{/branch}","tags_url":"https://api.github.com/repos/postcss/postcss-loader/tags","blobs_url":"https://api.github.com/repos/postcss/postcss-loader/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/postcss/postcss-loader/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/postcss/postcss-loader/git/refs{/sha}","trees_url":"https://api.github.com/repos/postcss/postcss-loader/git/trees{/sha}","statuses_url":"https://api.github.com/repos/postcss/postcss-loader/statuses/{sha}","languages_url":"https://api.github.com/repos/postcss/postcss-loader/languages","stargazers_url":"https://api.github.com/repos/postcss/postcss-loader/stargazers","contributors_url":"https://api.github.com/repos/postcss/postcss-loader/contributors","subscribers_url":"https://api.github.com/repos/postcss/postcss-loader/subscribers","subscription_url":"https://api.github.com/repos/postcss/postcss-loader/subscription","commits_url":"https://api.github.com/repos/postcss/postcss-loader/commits{/sha}","git_commits_url":"https://api.github.com/repos/postcss/postcss-loader/git/commits{/sha}","comments_url":"https://api.github.com/repos/postcss/postcss-loader/comments{/number}","issue_comment_url":"https://api.github.com/repos/postcss/postcss-loader/issues/comments{/number}","contents_url":"https://api.github.com/repos/postcss/postcss-loader/contents/{+path}","compare_url":"https://api.github.com/repos/postcss/postcss-loader/compare/{base}...{head}","merges_url":"https://api.github.com/repos/postcss/postcss-loader/merges","archive_url":"https://api.github.com/repos/postcss/postcss-loader/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/postcss/postcss-loader/downloads","issues_url":"https://api.github.com/repos/postcss/postcss-loader/issues{/number}","pulls_url":"https://api.github.com/repos/postcss/postcss-loader/pulls{/number}","milestones_url":"https://api.github.com/repos/postcss/postcss-loader/milestones{/number}","notifications_url":"https://api.github.com/repos/postcss/postcss-loader/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/postcss/postcss-loader/labels{/name}","releases_url":"https://api.github.com/repos/postcss/postcss-loader/releases{/id}","deployments_url":"https://api.github.com/repos/postcss/postcss-loader/deployments","created_at":"2014-10-03T15:29:46Z","updated_at":"2016-09-15T01:34:38Z","pushed_at":"2016-09-15T10:10:12Z","git_url":"git://github.com/postcss/postcss-loader.git","ssh_url":"git@github.com:postcss/postcss-loader.git","clone_url":"https://github.com/postcss/postcss-loader.git","svn_url":"https://github.com/postcss/postcss-loader","homepage":null,"size":97,"stargazers_count":683,"watchers_count":683,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":6,"forks":44,"open_issues":6,"watchers":683,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/postcss/postcss-loader/pulls/97"},"html":{"href":"https://github.com/postcss/postcss-loader/pull/97"},"issue":{"href":"https://api.github.com/repos/postcss/postcss-loader/issues/97"},"comments":{"href":"https://api.github.com/repos/postcss/postcss-loader/issues/97/comments"},"review_comments":{"href":"https://api.github.com/repos/postcss/postcss-loader/pulls/97/comments"},"review_comment":{"href":"https://api.github.com/repos/postcss/postcss-loader/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/postcss/postcss-loader/pulls/97/commits"},"statuses":{"href":"https://api.github.com/repos/postcss/postcss-loader/statuses/71943ce783ef9f35fd00997807324a6222bca583"}}}}
{"actor":{"display_login":"ertrzyiks"}}