Skip to content
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

bug: public path - how to handle subdomain subdirectories #12

Open
lastlink opened this issue Feb 24, 2021 · 2 comments
Open

bug: public path - how to handle subdomain subdirectories #12

lastlink opened this issue Feb 24, 2021 · 2 comments

Comments

@lastlink
Copy link

lastlink commented Feb 24, 2021

  • when I deploy to gitlab in a subdirectory I'm having issues getting the search json to work
  • I'm going to try updating the public path
    • didn't work as expected, does a duplicate path call

examples

@lastlink
Copy link
Author

best I can see is to update the publicpath in the build in nuxt.config.js

 build: {
    extractCSS: true,
    //publicPath: 'PATHPREFIXTOREPLACE/_nuxt',

but this is causing a bunch of path issues for me still w/ a duplicate. e.g. public path 2x for somereason when manually updated.

@lastlink lastlink changed the title how to handle subdomain subdirectories bug: public path - how to handle subdomain subdirectories Feb 24, 2021
@PetrusHahol
Copy link

PetrusHahol commented Mar 23, 2021

@lastlink
Faced the same issue. How I worked it around:

First add this to nuxt.config.js

 router: {
    base: process.env.ENV_SUB_PATH || '/'
  } 

and

build: {
  publicPath: (process.env.ENV_SUB_PATH || '/') + '_nuxt'
},

Then define ENV_SUB_PATH as /$CI_PROJECT_NAME/ within your ci/cd variables or pipeline

And then everywhere where its not root (has subdomains) you can do the same movements as
here .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants