Closed Anahkiasen closed 8 years ago
We shouldn't be outputting the localhost:8082
line, that's where we run our Node.js server!
Instead, go to where ever you run your local server (e.g. localhost:8080/carte-blanche
) and it's going to work!
@mxstbr Yes and no, it's generating the HTML with paths such as /carte-blanche/client-bundle.css
but in my case the files are output in /dist/carte-blanche
so the paths are incorrect. If I change the dest
option to /dist/carte-blanche
then it just generates them in /dist/dist/carte-blanche
.
Additionally I'm using HMR on my Express server like documented:
const config = require('../../webpack.config');
const compiler = require('webpack')(config);
app.use(require('webpack-dev-middleware')(compiler));
app.use(require('webpack-hot-middleware')(compiler));
But since CB is blocking (ie if I run webpack
it never stops) the server also gets stuck there, is this expected behavior?
The only way to get it to work currently is to comment out the HMR on the server and edit the paths in the generated HTML
Oh no, that's definitely a bug, our bad, that should definitely not be the case! Let me reopen this and we'll look into it!
Actually strike that, editing the paths in the HTML doesn't work, I mean Carte Blanche works but none of the components show up, it seems to still be pinging the old path:
Making the paths relative should work maybe? Like src="user-bundle.js"
that way no matter where CB is exported to, if you can access it, it can access its own files.
+1, same thing is happening to me too!
Yeah the bug seems to be somewhere along the piping of the dest
option, will take a look asap!
Working on this right now …
I tried boiling down my test to the bare minimum but I still can't seem to get this to work, is there anything I'm doing wrong here?
webpack.config.js
CategoryIcon.js
.babelrc
This is what I get when I compile:
I can see the files in
/dist/carte-blanche
but when I go to http://localhost:8082/ or http://localhost:8082/carte-blanche/ all I get isCannot GET /