{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/plugin-css/issues/80","repository_url":"https://api.github.com/repos/systemjs/plugin-css","labels_url":"https://api.github.com/repos/systemjs/plugin-css/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/plugin-css/issues/80/comments","events_url":"https://api.github.com/repos/systemjs/plugin-css/issues/80/events","html_url":"https://github.com/systemjs/plugin-css/pull/80","id":140685141,"number":80,"title":"allows for usage of node's clean-css","user":{"login":"amenadiel","id":238439,"avatar_url":"https://avatars.githubusercontent.com/u/238439?v=3","gravatar_id":"","url":"https://api.github.com/users/amenadiel","html_url":"https://github.com/amenadiel","followers_url":"https://api.github.com/users/amenadiel/followers","following_url":"https://api.github.com/users/amenadiel/following{/other_user}","gists_url":"https://api.github.com/users/amenadiel/gists{/gist_id}","starred_url":"https://api.github.com/users/amenadiel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amenadiel/subscriptions","organizations_url":"https://api.github.com/users/amenadiel/orgs","repos_url":"https://api.github.com/users/amenadiel/repos","events_url":"https://api.github.com/users/amenadiel/events{/privacy}","received_events_url":"https://api.github.com/users/amenadiel/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-03-14T14:19:05Z","updated_at":"2016-04-20T01:03:03Z","closed_at":"2016-04-20T00:58:35Z","pull_request":{"url":"https://api.github.com/repos/systemjs/plugin-css/pulls/80","html_url":"https://github.com/systemjs/plugin-css/pull/80","diff_url":"https://github.com/systemjs/plugin-css/pull/80.diff","patch_url":"https://github.com/systemjs/plugin-css/pull/80.patch"},"body":"I noticed that installing `clean-css` as a jspm package using `jspm install npm:clean-css --dev` installed a lot of dependencies (and added a lot of mappings to my config.js).\r\n\r\n```js\r\n    \"github:jspm/nodelibs-assert@0.1.0\": {\r\n      \"assert\": \"npm:assert@1.3.0\"\r\n    },\r\n    \"github:jspm/nodelibs-buffer@0.1.0\": {\r\n      \"buffer\": \"npm:buffer@3.6.0\"\r\n    },\r\n    \"github:jspm/nodelibs-events@0.1.1\": {\r\n      \"events\": \"npm:events@1.0.2\"\r\n    },\r\n    \"github:jspm/nodelibs-http@1.7.1\": {\r\n      \"Base64\": \"npm:Base64@0.2.1\",\r\n      \"events\": \"github:jspm/nodelibs-events@0.1.1\",\r\n      \"inherits\": \"npm:inherits@2.0.1\",\r\n      \"stream\": \"github:jspm/nodelibs-stream@0.1.0\",\r\n      \"url\": \"github:jspm/nodelibs-url@0.1.0\",\r\n      \"util\": \"github:jspm/nodelibs-util@0.1.0\"\r\n    },\r\n    \"github:jspm/nodelibs-https@0.1.0\": {\r\n      \"https-browserify\": \"npm:https-browserify@0.0.0\"\r\n    },\r\n    \"github:jspm/nodelibs-os@0.1.0\": {\r\n      \"os-browserify\": \"npm:os-browserify@0.1.2\"\r\n    },\r\n    \"github:jspm/nodelibs-path@0.1.0\": {\r\n      \"path-browserify\": \"npm:path-browserify@0.0.0\"\r\n    },\r\n    \"github:jspm/nodelibs-process@0.1.2\": {\r\n      \"process\": \"npm:process@0.11.2\"\r\n    },\r\n    \"github:jspm/nodelibs-stream@0.1.0\": {\r\n      \"stream-browserify\": \"npm:stream-browserify@1.0.0\"\r\n    },\r\n    \"github:jspm/nodelibs-url@0.1.0\": {\r\n      \"url\": \"npm:url@0.10.3\"\r\n    },\r\n    \"github:jspm/nodelibs-util@0.1.0\": {\r\n      \"util\": \"npm:util@0.10.3\"\r\n    },\r\n    \"npm:amdefine@1.0.0\": {\r\n      \"fs\": \"github:jspm/nodelibs-fs@0.1.2\",\r\n      \"module\": \"github:jspm/nodelibs-module@0.1.0\",\r\n      \"path\": \"github:jspm/nodelibs-path@0.1.0\",\r\n      \"process\": \"github:jspm/nodelibs-process@0.1.2\"\r\n    },\r\n    \"npm:assert@1.3.0\": {\r\n      \"util\": \"npm:util@0.10.3\"\r\n    },\r\n    \"npm:buffer@3.6.0\": {\r\n      \"base64-js\": \"npm:base64-js@0.0.8\",\r\n      \"child_process\": \"github:jspm/nodelibs-child_process@0.1.0\",\r\n      \"fs\": \"github:jspm/nodelibs-fs@0.1.2\",\r\n      \"ieee754\": \"npm:ieee754@1.1.6\",\r\n      \"isarray\": \"npm:isarray@1.0.0\",\r\n      \"process\": \"github:jspm/nodelibs-process@0.1.2\"\r\n    },\r\n    \"npm:clean-css@3.4.10\": {\r\n      \"buffer\": \"github:jspm/nodelibs-buffer@0.1.0\",\r\n      \"commander\": \"npm:commander@2.8.1\",\r\n      \"fs\": \"github:jspm/nodelibs-fs@0.1.2\",\r\n      \"http\": \"github:jspm/nodelibs-http@1.7.1\",\r\n      \"https\": \"github:jspm/nodelibs-https@0.1.0\",\r\n      \"os\": \"github:jspm/nodelibs-os@0.1.0\",\r\n      \"path\": \"github:jspm/nodelibs-path@0.1.0\",\r\n      \"process\": \"github:jspm/nodelibs-process@0.1.2\",\r\n      \"source-map\": \"npm:source-map@0.4.4\",\r\n      \"url\": \"github:jspm/nodelibs-url@0.1.0\",\r\n      \"util\": \"github:jspm/nodelibs-util@0.1.0\"\r\n    },\r\n    \"npm:commander@2.8.1\": {\r\n      \"child_process\": \"github:jspm/nodelibs-child_process@0.1.0\",\r\n      \"events\": \"github:jspm/nodelibs-events@0.1.1\",\r\n      \"fs\": \"github:jspm/nodelibs-fs@0.1.2\",\r\n      \"graceful-readlink\": \"npm:graceful-readlink@1.0.1\",\r\n      \"path\": \"github:jspm/nodelibs-path@0.1.0\",\r\n      \"process\": \"github:jspm/nodelibs-process@0.1.2\"\r\n    },\r\n    \"npm:core-util-is@1.0.2\": {\r\n      \"buffer\": \"github:jspm/nodelibs-buffer@0.1.0\"\r\n    },\r\n    \"npm:graceful-readlink@1.0.1\": {\r\n      \"fs\": \"github:jspm/nodelibs-fs@0.1.2\"\r\n    },\r\n    \"npm:https-browserify@0.0.0\": {\r\n      \"http\": \"github:jspm/nodelibs-http@1.7.1\"\r\n    },\r\n    \"npm:inherits@2.0.1\": {\r\n      \"util\": \"github:jspm/nodelibs-util@0.1.0\"\r\n    },\r\n    \"npm:os-browserify@0.1.2\": {\r\n      \"os\": \"github:jspm/nodelibs-os@0.1.0\"\r\n    },\r\n    \"npm:path-browserify@0.0.0\": {\r\n      \"process\": \"github:jspm/nodelibs-process@0.1.2\"\r\n    },\r\n    \"npm:process@0.11.2\": {\r\n      \"assert\": \"github:jspm/nodelibs-assert@0.1.0\"\r\n    },\r\n    \"npm:punycode@1.3.2\": {\r\n      \"process\": \"github:jspm/nodelibs-process@0.1.2\"\r\n    },\r\n    \"npm:readable-stream@1.1.13\": {\r\n      \"buffer\": \"github:jspm/nodelibs-buffer@0.1.0\",\r\n      \"core-util-is\": \"npm:core-util-is@1.0.2\",\r\n      \"events\": \"github:jspm/nodelibs-events@0.1.1\",\r\n      \"inherits\": \"npm:inherits@2.0.1\",\r\n      \"isarray\": \"npm:isarray@0.0.1\",\r\n      \"process\": \"github:jspm/nodelibs-process@0.1.2\",\r\n      \"stream-browserify\": \"npm:stream-browserify@1.0.0\",\r\n      \"string_decoder\": \"npm:string_decoder@0.10.31\"\r\n    },\r\n    \"npm:source-map@0.4.4\": {\r\n      \"amdefine\": \"npm:amdefine@1.0.0\",\r\n      \"process\": \"github:jspm/nodelibs-process@0.1.2\"\r\n    },\r\n    \"npm:stream-browserify@1.0.0\": {\r\n      \"events\": \"github:jspm/nodelibs-events@0.1.1\",\r\n      \"inherits\": \"npm:inherits@2.0.1\",\r\n      \"readable-stream\": \"npm:readable-stream@1.1.13\"\r\n    },\r\n    \"npm:string_decoder@0.10.31\": {\r\n      \"buffer\": \"github:jspm/nodelibs-buffer@0.1.0\"\r\n    },\r\n    \"npm:url@0.10.3\": {\r\n      \"assert\": \"github:jspm/nodelibs-assert@0.1.0\",\r\n      \"punycode\": \"npm:punycode@1.3.2\",\r\n      \"querystring\": \"npm:querystring@0.2.0\",\r\n      \"util\": \"github:jspm/nodelibs-util@0.1.0\"\r\n    },\r\n    \"npm:util@0.10.3\": {\r\n      \"inherits\": \"npm:inherits@2.0.1\",\r\n      \"process\": \"github:jspm/nodelibs-process@0.1.2\"\r\n    }\r\n```\r\n\r\n\r\n As most of them were of the `nodelibs` family, I figured the step of building through `clean-css` should be able to run as a node module instead of bringing so many friends into a place where only browser modules should live.\r\n\r\nSo in this PR the `bundle` method of `css-builder` tries to do a `System._nodeRequire('clean-css')`. If it can't, then it tries to call `loader['import']('clean-css')`. If both of them fail then an error is thrown."},"comment":{"url":"https://api.github.com/repos/systemjs/plugin-css/issues/comments/212190126","html_url":"https://github.com/systemjs/plugin-css/pull/80#issuecomment-212190126","issue_url":"https://api.github.com/repos/systemjs/plugin-css/issues/80","id":212190126,"user":{"login":"guybedford","id":598730,"avatar_url":"https://avatars.githubusercontent.com/u/598730?v=3","gravatar_id":"","url":"https://api.github.com/users/guybedford","html_url":"https://github.com/guybedford","followers_url":"https://api.github.com/users/guybedford/followers","following_url":"https://api.github.com/users/guybedford/following{/other_user}","gists_url":"https://api.github.com/users/guybedford/gists{/gist_id}","starred_url":"https://api.github.com/users/guybedford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guybedford/subscriptions","organizations_url":"https://api.github.com/users/guybedford/orgs","repos_url":"https://api.github.com/users/guybedford/repos","events_url":"https://api.github.com/users/guybedford/events{/privacy}","received_events_url":"https://api.github.com/users/guybedford/received_events","type":"User","site_admin":false},"created_at":"2016-04-20T01:03:03Z","updated_at":"2016-04-20T01:03:03Z","body":"Released in 0.1.21."}}