{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babelify/issues/151","labels_url":"https://api.github.com/repos/babel/babelify/issues/151/labels{/name}","comments_url":"https://api.github.com/repos/babel/babelify/issues/151/comments","events_url":"https://api.github.com/repos/babel/babelify/issues/151/events","html_url":"https://github.com/babel/babelify/issues/151","id":116413098,"number":151,"title":"babelrc is not read when using babelify","user":{"login":"kirbysayshi","id":90831,"avatar_url":"https://avatars.githubusercontent.com/u/90831?v=3","gravatar_id":"","url":"https://api.github.com/users/kirbysayshi","html_url":"https://github.com/kirbysayshi","followers_url":"https://api.github.com/users/kirbysayshi/followers","following_url":"https://api.github.com/users/kirbysayshi/following{/other_user}","gists_url":"https://api.github.com/users/kirbysayshi/gists{/gist_id}","starred_url":"https://api.github.com/users/kirbysayshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirbysayshi/subscriptions","organizations_url":"https://api.github.com/users/kirbysayshi/orgs","repos_url":"https://api.github.com/users/kirbysayshi/repos","events_url":"https://api.github.com/users/kirbysayshi/events{/privacy}","received_events_url":"https://api.github.com/users/kirbysayshi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-11-11T20:17:20Z","updated_at":"2015-11-17T03:39:51Z","closed_at":null,"body":"It appears that something is preventing babel from reading in the local .babelrc when running via babelify. Here is a gist that demonstrates the problem: https://gist.github.com/kirbysayshi/c0df1bf8bbbac53d0c1c\r\n\r\n```sh\r\n$ git clone https://gist.github.com/kirbysayshi/c0df1bf8bbbac53d0c1c babelify-test && cd babelify-test\r\n$ npm install\r\n...\r\n$ npm run js\r\n> babelify-test@0.0.0 js /private/tmp/babelify-test\r\n> browserify index.js -o bundle.js\r\n\r\n\r\n/private/tmp/babelify-test/index.js:1\r\nimport Promise from 'es6-promise';\r\n^\r\nParseError: 'import' and 'export' may appear only with 'sourceType: module'\r\n```\r\n\r\nIf I place the `presets` key within the package.json browserify config, then the code compiles just fine. I believe this worked before babel 6, so perhaps it's an upstream bug. Not sure."},"comment":{"url":"https://api.github.com/repos/babel/babelify/issues/comments/157258766","html_url":"https://github.com/babel/babelify/issues/151#issuecomment-157258766","issue_url":"https://api.github.com/repos/babel/babelify/issues/151","id":157258766,"user":{"login":"kirbysayshi","id":90831,"avatar_url":"https://avatars.githubusercontent.com/u/90831?v=3","gravatar_id":"","url":"https://api.github.com/users/kirbysayshi","html_url":"https://github.com/kirbysayshi","followers_url":"https://api.github.com/users/kirbysayshi/followers","following_url":"https://api.github.com/users/kirbysayshi/following{/other_user}","gists_url":"https://api.github.com/users/kirbysayshi/gists{/gist_id}","starred_url":"https://api.github.com/users/kirbysayshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirbysayshi/subscriptions","organizations_url":"https://api.github.com/users/kirbysayshi/orgs","repos_url":"https://api.github.com/users/kirbysayshi/repos","events_url":"https://api.github.com/users/kirbysayshi/events{/privacy}","received_events_url":"https://api.github.com/users/kirbysayshi/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T03:39:51Z","updated_at":"2015-11-17T03:39:51Z","body":"@zertosh thanks for the tip regarding sourceMapRelative. Removing that worked!\r\n\r\nI agree it's not obvious that babelify (via babel) reads babelrc, since most libraries in my experience don't read configuration from the file system unless it's run as a command line tool. In this case, I'm very glad babelify and babel behave this way, because it allows for my configuration to exist in only one place. Especially for things like npm scripts and node-babel.\r\n\r\nThanks for responding so quickly!\r\n\r\n"}}