nuxt-community / nuxtent-module

Seamlessly use content files in your Nuxt.js sites.
https://nuxtent-module.netlify.com/guide
MIT License
389 stars 50 forks source link

Fix custom baseURL bug effecting browserBaseURL. #175

Closed jmcmullen closed 6 years ago

jmcmullen commented 6 years ago

Upon changing my baseURL, the browserBaseURL was changing on the output of my statically generated site to include it. This is not good because it only needs changed when generating, not the final output. This commit fixes that issue.

Nuxtent config:

nuxtent {
    content,
    api {
        baseURL: 'http://localhost:8080',
    }
}

Before:

… debug nuxt › axios › baseURL: http://localhost:8080/content-api
… debug nuxt › axios › browserBaseURL: http://localhost:8080/_nuxt/content

After:

… debug nuxt › axios › baseURL: http://localhost:8080/content-api
… debug nuxt › axios › browserBaseURL: /_nuxt/content
cesasol commented 6 years ago

I took the liberty to fix your changes since the browserBaseURL was inserting into the baseURL, I tested but I would like you to test on your end to ensure this will not break any current sites

jmcmullen commented 6 years ago

Looking good on my end. Awesome!