{"action":"created","issue":{"url":"https://api.github.com/repos/skorlir/ava-jspm-loader/issues/2","repository_url":"https://api.github.com/repos/skorlir/ava-jspm-loader","labels_url":"https://api.github.com/repos/skorlir/ava-jspm-loader/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/skorlir/ava-jspm-loader/issues/2/comments","events_url":"https://api.github.com/repos/skorlir/ava-jspm-loader/issues/2/events","html_url":"https://github.com/skorlir/ava-jspm-loader/issues/2","id":163632991,"number":2,"title":"Compatibility with `babel-plugin-module-alias`","user":{"login":"kdex","id":4442505,"avatar_url":"https://avatars.githubusercontent.com/u/4442505?v=3","gravatar_id":"","url":"https://api.github.com/users/kdex","html_url":"https://github.com/kdex","followers_url":"https://api.github.com/users/kdex/followers","following_url":"https://api.github.com/users/kdex/following{/other_user}","gists_url":"https://api.github.com/users/kdex/gists{/gist_id}","starred_url":"https://api.github.com/users/kdex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdex/subscriptions","organizations_url":"https://api.github.com/users/kdex/orgs","repos_url":"https://api.github.com/users/kdex/repos","events_url":"https://api.github.com/users/kdex/events{/privacy}","received_events_url":"https://api.github.com/users/kdex/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-04T09:02:58Z","updated_at":"2016-07-04T15:53:42Z","closed_at":null,"body":"In my project, only the client-side code is jspm-dependent, while the server code just runs transpiled modules directly.\r\n\r\nIn order to support module aliases on the server-side, I'm using `babel-plugin-module-alias`, which makes my `.babelrc\" look something like:\r\n\r\n```json\r\n{\r\n\t\"plugins\": [[\r\n\t\t\"module-alias\", [{\r\n\t\t\t\"src\": \"./src/client/js\",\r\n\t\t\t\"expose\": \"client\"\r\n\t\t}, {\r\n\t\t\t\"src\": \"./\",\r\n\t\t\t\"expose\": \"map-game\"\r\n\t\t}]]\r\n\t],\r\n\t\"presets\": [\r\n\t\t\"es2015\",\r\n\t\t\"react\",\r\n\t\t\"stage-0\"\r\n\t]\r\n}\r\n```\r\n\r\nThis setup works fine until I try to add `ava-jspm-loader` into the `require` section of my `package.json`. If I try to run my tests, this happens:\r\n\r\n```bash\r\n╭─kdex@map-game ~/srv  ‹master*› \r\n╰─$ gulp cover                                                                                                                                        1 ↵\r\n[10:51:57] Requiring external module babel-register\r\n(node:9306) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.\r\n[10:51:59] Using gulpfile ~/srv/gulpfile.babel.js\r\n[10:51:59] Starting 'cover'...\r\n/home/kdex/srv/node_modules/babel-core/lib/transformation/file/options/option-manager.js:170\r\n        throw new TypeError(messages.get(\"pluginNotFunction\", loc, i, typeof plugin === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(plugin)));\r\n        ^\r\n\r\nTypeError: Plugin 0 specified in \"/home/kdex/srv/.babelrc\" was expected to return a function but returned \"undefined\"\r\n    at Function.normalisePlugin (/home/kdex/srv/node_modules/babel-core/lib/transformation/file/options/option-manager.js:170:15)\r\n    at /home/kdex/srv/node_modules/babel-core/lib/transformation/file/options/option-manager.js:208:30\r\n    at Array.map (native)\r\n    at Function.normalisePlugins (/home/kdex/srv/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:20)\r\n    at OptionManager.mergeOptions (/home/kdex/srv/node_modules/babel-core/lib/transformation/file/options/option-manager.js:300:36)\r\n    at OptionManager.addConfig (/home/kdex/srv/node_modules/babel-core/lib/transformation/file/options/option-manager.js:232:10)\r\n    at OptionManager.findConfigs (/home/kdex/srv/node_modules/babel-core/lib/transformation/file/options/option-manager.js:436:16)\r\n    at OptionManager.init (/home/kdex/srv/node_modules/babel-core/lib/transformation/file/options/option-manager.js:484:12)\r\n    at compile (/home/kdex/srv/node_modules/babel-register/lib/node.js:112:69)\r\n    at loader (/home/kdex/srv/node_modules/babel-register/lib/node.js:158:14)\r\n    at require.extensions.(anonymous function) (/home/kdex/srv/node_modules/babel-register/lib/node.js:168:7)\r\n    at Object.<anonymous> (/home/kdex/srv/node_modules/nyc/node_modules/append-transform/index.js:62:4)\r\n    at Module.load (module.js:458:32)\r\n    at tryModuleLoad (module.js:417:12)\r\n    at Module._load (module.js:409:3)\r\n    at Function.Module._load (/home/kdex/srv/node_modules/ava-jspm-loader/jspm-loader.js:71:10)\r\n```\r\n\r\nWhat's the problem here?"},"comment":{"url":"https://api.github.com/repos/skorlir/ava-jspm-loader/issues/comments/230318372","html_url":"https://github.com/skorlir/ava-jspm-loader/issues/2#issuecomment-230318372","issue_url":"https://api.github.com/repos/skorlir/ava-jspm-loader/issues/2","id":230318372,"user":{"login":"kdex","id":4442505,"avatar_url":"https://avatars.githubusercontent.com/u/4442505?v=3","gravatar_id":"","url":"https://api.github.com/users/kdex","html_url":"https://github.com/kdex","followers_url":"https://api.github.com/users/kdex/followers","following_url":"https://api.github.com/users/kdex/following{/other_user}","gists_url":"https://api.github.com/users/kdex/gists{/gist_id}","starred_url":"https://api.github.com/users/kdex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdex/subscriptions","organizations_url":"https://api.github.com/users/kdex/orgs","repos_url":"https://api.github.com/users/kdex/repos","events_url":"https://api.github.com/users/kdex/events{/privacy}","received_events_url":"https://api.github.com/users/kdex/received_events","type":"User","site_admin":false},"created_at":"2016-07-04T15:53:42Z","updated_at":"2016-07-04T15:53:42Z","body":"Sure. It currently looks like so:\r\n\r\n```json\r\n  \"ava\": {\r\n    \"babel\": {\r\n      \"presets\": [\r\n        \"es2015\",\r\n        \"stage-0\"\r\n      ]\r\n    },\r\n    \"require\": [\r\n      \"babel-polyfill\"\r\n    ]\r\n  },\r\n  \"nyc\": {\r\n    \"include\": [\r\n      \"src/**/*.js\"\r\n    ],\r\n    \"sourceMap\": false,\r\n    \"instrument\": false,\r\n    \"require\": [\r\n      \"babel-register\",\r\n      \"ava-jspm-loader\"\r\n    ],\r\n    \"exclude\": [\r\n      \"dist\",\r\n      \"components\",\r\n      \"packages\",\r\n      \"node_modules\"\r\n    ],\r\n    \"all\": false\r\n  }\r\n```"}}
{"actor":{"display_login":"kdex"}}