Browserify with babelify throws error
I am trying to create a simple Hello World example which uses the latest react and babel for transformation.
But I am unable to get the transformation to run successfully and output me a bundle.js
The source code of the project is available at https://github.com/singhshashi/babelify-issue
Surely I am making a simple mistake that this simple task is not working. But I have reread the docs and I am not sure what I am missing over here.
Any idea?
====EDIT==========
There are two error messages in the screenshot that I have shared. The first happens when I am not specifying options in the command line, since I thought the options from .babelrc file would be read.The second error message comes when I explicitly specify the additional options in the command line.
I suspect the first issue may be due to https://github.com/babel/babelify/issues/151
So for the time being, it makes sense to focus only on the second error message. Which module is not found? And should it not be looking for modules in node_modules? Digging deeper..
It looks like you may need to pass babelify
as a transform option in your command.
Try running browserify app.jsx -o bundle.js -t babelify
I was able to build your code using your .babelrc
file and running that command.