jpsierens / webpack-react-redux

A boilerplate for playing around with react, redux and react-router with the help of webpack.
MIT License
599 stars 196 forks source link

npm run build is not working #3

Closed BenGedi closed 8 years ago

BenGedi commented 8 years ago

Hey,

I'm using your boilerplate and npm run build having some errors, can you please tell me what i'm missing?

screen capture image https://www.dropbox.com/s/3tmbonbxuijt1pq/2016-07-23_19-06-58.png?dl=0#

jpsierens commented 8 years ago

I went ahead and tested on my mac and it works fine. It must be something related to Windows, maybe it's the pathing? i.e. using \ instead of / for the paths.

jpsierens commented 8 years ago

Maybe someone with windows can help

Vija02 commented 8 years ago

Might be related to this https://github.com/isaacs/rimraf/issues/62

maximilianb8 commented 8 years ago

I've the same problem on Windows and isaacs/rimraf#62 doesn't work. Now I remove rimraf dist and i create the directory dist and npm run build is ok. But when I open the ./dist/index.html there's a blank page. The js and css file are correctly included...

thanks

Tushkiz commented 8 years ago

updating build script in package.json from

"build": "rimraf dist && node_modules/.bin/webpack --config ./webpack.production.config.js --progress --profile --colors"

to

"build": "rimraf dist && webpack --config ./webpack.production.config.js --progress --profile --colors"

solves the issue

Thanks.

jpsierens commented 8 years ago

Thanks @Tushkiz

It looks like using the global webpack solves the issue

Closing this

Tushkiz commented 8 years ago

@jpsierens you are welcome! Global webpack is not required either, when called from npm scripts it is resolved local first.

jpsierens commented 8 years ago

True!

hobbeshunter commented 7 years ago

@maximilianb8 it's a bit late, but in case anyone else stumples across that, here is an answer:

It's probably because you're not running it in a server and therefore browserHistory doesn't work. Change browserHistory to hashHistory in your index.js and it should work just fine. Read more here https://github.com/ReactTraining/react-router/blob/master/docs/guides/Histories.md