Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI inline presets not working? #221

Closed
patrickfabrizius opened this issue Nov 24, 2016 · 4 comments
Closed

CLI inline presets not working? #221

patrickfabrizius opened this issue Nov 24, 2016 · 4 comments

Comments

@patrickfabrizius
Copy link

I was setting up ES2015 transpilation for a new project with regards of the changes since Babel 6. Following the instructions on https://github.com/babel/babelify gives me no errors but my bundle is not transpiled:

$ browserify script.js -o bundle.js -t [ babelify --presets [ es2015 ] ]

However, configuring a preset in package.json (or .babelrc) like so:

 "babel": {
    "presets": ["es2015"]
  }

And then just running:
$ browserify index.js -o bundle.js -t babelify

Gives me a transpiled bundle.

Environment:
OSX 10.11.6
NPM 4.0.3
Browserify 13.1.1
Babelify 7.3.0

@stevage
Copy link

stevage commented Dec 15, 2016

For me, running the command above causes this error:

path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
...

Googling that suggests that babel-core needs to be updated. Your suggestion gave me a useful workaround, thanks!

@patrickfabrizius
Copy link
Author

Glad I could help(?) :)
I have babel-core 6.18.2 myself which is higher than suggested in the link so I don't think our problems are related. To bad no-one else here cares :)

@jonahx
Copy link

jonahx commented Mar 27, 2017

@patrickfabrizius Thanks for posting this. You saved me. I am pretty confused how such a core bug, if that's what this is, is still open.

@loganfsmyth
Copy link
Member

I'm triaging old issues on babelify. Since this has been inactive for ages, I'm going to close it. Feel free to re-open if there's still something to discuss, but I'm assuming at this point it's been too long to address in a useful way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants