Docusaurus: Add baseUrl to the link suggested by the dev server on start

Created on 13 Aug 2020  Â·  12Comments  Â·  Source: facebook/docusaurus

🚀 Feature

When baseUrl is used, dev server should suggest opening the URL with that baseUrl. It should be localhost:port/baseUrl But now it suggests opening just localhost:port.

Have you read the Contributing Guidelines on issues?

Yeah.

Motivation

It would be more convenient. Now you click on the suggested link and see the 404-page every time you start the dev server.

  Compiled successfully in 9.48s

ℹ 「wds」: Project is running at http://localhost:3000/

Pitch

See Motivation.
This feature request is actually more like a bug report. Wasn't sure which one I should pick.

starter feature good first issue help wanted mlh

All 12 comments

I will handle it.

Please Just give me a little information about how to do that?

@Ako92 I have no idea, maybe it's something out of our control inside Webpack :) Please investigate and tell us what you think

Please Just give me a little information about how to do that?

I think changing webpack-dev-server config should work.
@Ako92 this should work https://webpack.js.org/configuration/dev-server/#devserveropenpage

dev server auto open browser is fine
when you change baseUrl in docusaurus.config.js and start the project it show browser with new baseUrl. Thats fine

The problem is that i should change this url
image

@slorber This is open?

@imskr I'll merge the first PR that solves this problem so if you find a solution let me know as it seems @Ako92 didn't

@slorber Is this issue still open?

@sarthakkundra and I would like to take this up as a good first issue for MLH.

We think that we may have a workaround for the issue to fulfil the motivation. It looks like the lines starting with wds are actually from weback-dev-server. So modifying those would be out of scope. As per the motivation, a simple solution would be to add an output with the website's correct URL such that:

image

Thanks @utkarsh867 you can take this issue.

Your solution can be a workaround if it's not possible to modify the URL displayed by WDS

@slorber From what I understand after reading up about WDS, the URL displayed in the console makes sense because it indicates that the WDS is running at the specific port.

@utkarsh867 yes it makes sense for WDS and I'm not sure we can do anything about it anyway. If we don't change anything it's not a big deal.

Maybe just showing "docusaurus website is running at http://localhost:8000/baseUrl" is good enough?

I'll let @maksnester tell you why he thinks it's important. For me now having the baseUrl printed by WDS has never been a big deal, but I may lack the perspective of a junior dev or something that is not used to frontend dev at all.

Thanks @utkarsh867 the new output is

image

WDS log does not include the baseurl but I think it's good enough so that we can close this issue.
If you feel it's not enough please open a PR with an implementation proposition.

Was this page helpful?
0 / 5 - 0 ratings