antwarjs / antwar

A static site generator built with React and Webpack.
https://antwar.js.org/
MIT License
460 stars 35 forks source link

Relative Links in Development vs. Production #125

Closed skipjack closed 7 years ago

skipjack commented 7 years ago

From webpack/webpack.js.org#1087...

It seems in production on webpack.js.org a trailing slash is added which doesn't exist in development. This causes relative urls like ./writers-guide to work in development but fail in production leading to some confusion.

Production: https://webpack.js.org/support/ Development: https://webpack.js.org/support

bebraw commented 7 years ago

The trailing slash has to do with the fact that it actually generates something like support/index.html by design. I think I have to force the router to use trailing slashes always somehow.

Note that Antwar is using react-router 4 now (updated today).

bebraw commented 7 years ago

Can you try the dev version? Now I force everything to have a trailing slash so it's at least consistent. The error handling could be far better as now it's just a console message. That needs something better.

skipjack commented 7 years ago

Did you bump the antwar version on webpack.js.org already? If so, I'd be happy to test.

The error handling could be far better as now it's just a console message. That needs something better.

The error handling for what?

bebraw commented 7 years ago

I haven't bumped the version yet as it's a bigger change (needs update to webpack 2 while at it).

Error handling as in accessing invalid url. It still renders something and you get a message in the console. Likely that needs a nice error message page instead but that's an easy problem.

skipjack commented 7 years ago

Ok, yeah I'd be happy to create a nice 404 page at some point.