-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add publicPath type of option to generate #1052
Comments
Hey. You have to use router.base |
Great, thanks! |
Having the same problem i guess... i currently have the thing is i thought maybe providing a empty string as router base would solve it but it didn't, guess no way of testing it locally ! |
one other problem with is that this also affects fragment routing such as |
This might be useful: https://github.com/IBM/vue-a11y-calendar/blob/master/docs/nuxt.config.js |
I need to set a publicPath. |
@MartinX3 in build extend |
@aldarund |
Has anybody found a way to set this to a relative path so, say, a client can drop the static files wherever they want on their web server and they work without having to rebuild the project? I'm in a situation where I don't know what path will be used, so I have to use relative paths. |
@cdunlap Use a relative path in
|
@evry-johber That appears to break Here's the path in SCSS: Its a step in the right direction for sure, but it doesn't seem to be the full solution. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi!
I tried to publish generated Nuxt page to Github pages. It is served from a subdirectory: username.gihub.io/projectname. This causes 404s because asset references start with '/'. For example _nuxt folder:
Failed to load resource: the server responded with a status of 404 (Not Found) /_nuxt/1.nuxt.bundle.5b7c88cf02a549fbbf73.js
The path should be: /projectname/_nuxt/1.nuxt.bundle.5b7c88cf02a549fbbf73.js
Or: https://username.gihub.io/projectname/_nuxt/1.nuxt.bundle.5b7c88cf02a549fbbf73.js
I couldn't find any good workaround.
It seems that $ nuxt build has a publicPath option that allows changing the dist folder location. It would be great to have similar option for $nuxt generate also. Default could be '/' but changing it to '/projectname/' would solve the problem in Github pages case. This path should also be prepended in the head section of nuxt.config.js where references to local files are made.
The text was updated successfully, but these errors were encountered: