vigetlabs / blendid

A delicious blend of gulp tasks combined into a configurable asset pipeline and static site builder
MIT License
4.97k stars 680 forks source link

Wepback Path issue on Windows #262

Closed greypants closed 8 years ago

greypants commented 8 years ago

@chaelli's description copied from https://github.com/vigetlabs/gulp-starter/pull/257#issuecomment-202039278

since this update I get a 404 on the http://localhost:3000/javascripts/app.js - there's also no "javascripts" folder in the "public" folder. Any idea what could be wrong? the paths seem to be correct...

Update:

ouch.. found the issue.. Windows again ;) just add ".replace(/\/g, '/')" to the following line in webpack-multi-config.js to fix it: var publicPath = path.join(config.tasks.js.dest, '/')

greypants commented 8 years ago

Good ol' Windows paths. I thought path.join should normalize that. Maybe I need to do it explicitly.

Does this work for you?

var publicPath = path.normalize(config.tasks.js.dest +  '/')

I forget why I needed that trailing slash... I'm sure I added it for a reason at some point. But I'll try it again without it.

chaelli commented 8 years ago

nope, normalize doesn't work - I guess normalize replaces all / and \ with the appropriate character for the current OS. So for windows it will replace all with \ => but as this "path" is not used as "path" but as "url", it doesn't work.

greypants commented 8 years ago

Ah. Right, we're converting a windows path to a URL. Your suggestion sounds like it should be good enough. Will add.