{"action":"created","issue":{"url":"https://api.github.com/repos/istarkov/babel-plugin-webpack-loaders/issues/58","repository_url":"https://api.github.com/repos/istarkov/babel-plugin-webpack-loaders","labels_url":"https://api.github.com/repos/istarkov/babel-plugin-webpack-loaders/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/istarkov/babel-plugin-webpack-loaders/issues/58/comments","events_url":"https://api.github.com/repos/istarkov/babel-plugin-webpack-loaders/issues/58/events","html_url":"https://github.com/istarkov/babel-plugin-webpack-loaders/issues/58","id":143519199,"number":58,"title":"ava and \"Unexpected token import\"","user":{"login":"MoOx","id":157534,"avatar_url":"https://avatars.githubusercontent.com/u/157534?v=3","gravatar_id":"","url":"https://api.github.com/users/MoOx","html_url":"https://github.com/MoOx","followers_url":"https://api.github.com/users/MoOx/followers","following_url":"https://api.github.com/users/MoOx/following{/other_user}","gists_url":"https://api.github.com/users/MoOx/gists{/gist_id}","starred_url":"https://api.github.com/users/MoOx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MoOx/subscriptions","organizations_url":"https://api.github.com/users/MoOx/orgs","repos_url":"https://api.github.com/users/MoOx/repos","events_url":"https://api.github.com/users/MoOx/events{/privacy}","received_events_url":"https://api.github.com/users/MoOx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-25T15:05:15Z","updated_at":"2016-03-25T15:59:13Z","closed_at":null,"body":"Hi,\r\n\r\nI am trying to run tests with AVA and your plugin.\r\nAt the first place, it wasn't working (error below). I rm -rf node_modules, then tried again and it was working (tests on jsx and react were failing as expected). No idea why, I changed a string in my file, and got this error:\r\n\r\n```\r\nUncaught Exception: /Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/web_modules/Button/__tests__/index.js\r\n  SyntaxError: /Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/web_modules/Button/__tests__/index.js: Unexpected token import\r\n    at exports.runInThisContext (vm.js:53:16)\r\n    at Module._compile (module.js:387:25)\r\n    at Object.Module._extensions..js (module.js:422:10)\r\n    at Module.load (module.js:357:32)\r\n    at Function.Module._load (module.js:314:12)\r\n    at Module.require (module.js:367:17)\r\n    at require (internal/module.js:16:19)\r\n    at localInteropRequire (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-plugin-webpack-loaders/lib/plugin.js:211:13)\r\n    at PluginPass.CallExpression (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-plugin-webpack-loaders/lib/plugin.js:41:135)\r\n    at newFn (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-traverse/lib/visitors.js:262:19)\r\n    at NodePath._call (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-traverse/lib/path/context.js:63:18)\r\n    at NodePath.call (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-traverse/lib/path/context.js:47:17)\r\n    at NodePath.visit (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-traverse/lib/path/context.js:93:12)\r\n    at TraversalContext.visitQueue (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-traverse/lib/context.js:152:16)\r\n    at TraversalContext.visitSingle (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-traverse/lib/context.js:115:19)\r\n    at TraversalContext.visit (/Users/MoOx/Sync/Development/_clients/one2team/o3-mobile/node_modules/babel-traverse/lib/context.js:184:19)\r\n```\r\n\r\nI reverted my changes but same problem.\r\n\r\nNote that I run with the following command (I just pasted interesting part)\r\n\r\n```js\r\n{\r\n  \"scripts\": {\r\n    \"ava\": \"CONFIG=$(pwd)/webpack.config.test.babel.js BABEL_DISABLE_CACHE=1 NODE_ENV=test ava\",\r\n    \"test\": \"npm run lint && npm run ava\"\r\n  },\r\n  \"babel\": {\r\n    \"presets\": [\r\n      \"babel-preset-react\",\r\n      \"babel-preset-es2015\",\r\n      \"babel-preset-stage-1\"\r\n    ],\r\n    \"env\": {\r\n      \"production\": {\r\n        \"plugins\": [\r\n          \"babel-plugin-react-remove-prop-types\"\r\n        ]\r\n      },\r\n      \"test\": {\r\n        \"plugins\": [\r\n          [\r\n            \"babel-plugin-webpack-loaders\",\r\n            {\r\n              \"config\": \"${CONFIG}\",\r\n              \"verbose\": false\r\n            }\r\n          ]\r\n        ]\r\n      }\r\n    }\r\n  },\r\n  \"ava\": {\r\n    \"files\": [\r\n      \"web_modules/**/__tests__/*.js\"\r\n    ],\r\n    \"failFast\": true,\r\n    \"verbose\": true,\r\n    \"require\": [\r\n      \"babel-register\"\r\n    ],\r\n    \"babel\": \"inherit\"\r\n  },\r\n```\r\n\r\nI cannot share my webpack config as it's very messy and private, just be sure that I use this \r\n\r\n```js\r\n// import normal config\r\nimport webpackConfig from \"./webpack.config.babel.js\"\r\n\r\nexport default {\r\n  ...webpackConfig,\r\n\r\n  // babel-plugin-webpack-loaders requirements\r\n  entry: undefined,\r\n  output: {\r\n    libraryTarget: \"commonjs2\",\r\n  },\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/istarkov/babel-plugin-webpack-loaders/issues/comments/201342883","html_url":"https://github.com/istarkov/babel-plugin-webpack-loaders/issues/58#issuecomment-201342883","issue_url":"https://api.github.com/repos/istarkov/babel-plugin-webpack-loaders/issues/58","id":201342883,"user":{"login":"istarkov","id":5077042,"avatar_url":"https://avatars.githubusercontent.com/u/5077042?v=3","gravatar_id":"","url":"https://api.github.com/users/istarkov","html_url":"https://github.com/istarkov","followers_url":"https://api.github.com/users/istarkov/followers","following_url":"https://api.github.com/users/istarkov/following{/other_user}","gists_url":"https://api.github.com/users/istarkov/gists{/gist_id}","starred_url":"https://api.github.com/users/istarkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istarkov/subscriptions","organizations_url":"https://api.github.com/users/istarkov/orgs","repos_url":"https://api.github.com/users/istarkov/repos","events_url":"https://api.github.com/users/istarkov/events{/privacy}","received_events_url":"https://api.github.com/users/istarkov/received_events","type":"User","site_admin":false},"created_at":"2016-03-25T15:59:13Z","updated_at":"2016-03-25T15:59:13Z","body":"looks like for some reason it does not expect that index.js is es6 module. Will try today to add ava to tests.  "}}