Closed srph closed 9 years ago
npm run build
probably isn't working either, you just can't see it because you're swallowing the error with the -v
for version. You need to specify --extension
for both. "extension"
in the browserify field doesn't work. This should do it and keep it "symmetrical" looking:
"scripts": {
"build": "browserify ./src/App.js --extension=.jsx --verbose -d > dist/script.js",
"watch": "watchify ./src/App.js --extension=.jsx --verbose -d -o dist/script.js"
},
"browserify": {
"transform": [ [ "reactify", { "es6": true } ] ]
}
Oh, I see. I apologize for not closing this issue asap when this has been answered in Stack Overflow.
Thanks :+1:
I have this package.json:
npm run build
(browserify) works as intended, reading .jsx files without specifying the extension (require('./components/Yolo')
works where inYolo
is ajsx
file,Yolo.jsx
). However, watchify throws an error:I tried adding
--extension=.jsx
to thewatch
command which works. However, I'd like to put the extension option away to make the commands DRY and clean as possibleIs there anything I am doing wrong? Thanks.