I am using browserify and watchify, and would like to require()
files other than the default extensions .js
and .json
without specifying the extension, for instance:
// Not ideal (tedious)
var Carousel = require('./components/Carousel/Carousel.jsx')
// Ideal
var Carousel = require('./components/Carousel/Carousel')
I have tried --extension=EXTENSION
as specified in the browserify documentation:
"scripts": {
"build": "browserify ./src/App.js --transform [ reactify --es6 ] > dist/script.js -v -d --extension=jsx",
"watch": "watchify ./src/App.js --transform [ reactify --es6 ] -o dist/script.js -v -d --extension=jsx"
},
However I don't see any change. Is this possible? What would be the right way to do this?