Nuxt.js: public path problem

Created on 15 Aug 2017  路  2Comments  路  Source: nuxt/nuxt.js

I want to set the public path to be a relative path.

for example, i want this:

<script src="assets/manifest.ec59716a348942b2b17f.js"></script>
<script src="assets/1.nuxt.bundle.0cf0418edc2e2a30a9d7.js"></script>

But it always generates to this:

<script src="/assets/manifest.ec59716a348942b2b17f.js"></script>
<script src="/assets/1.nuxt.bundle.0cf0418edc2e2a30a9d7.js"></script>

This is my nuxt.config.js:

build: {
    publicPath: 'assets/'
}

I don't know why it always adds a "/" in the path.

This question is available on Nuxt.js community (#c1225)
question

Most helpful comment

Hi. First of all assets dir are not being served like this. (They are serverd with route so /robots.txt ~> ~/assets/robots.txt).
Also if we use relative paths for _nuxt dir pages render would be broken (as there is no for example /dashboard/stats/_nuxt/1.nuxt.bundle.0cf0418edc2e2a30a9d7.js file).

All 2 comments

Hi. First of all assets dir are not being served like this. (They are serverd with route so /robots.txt ~> ~/assets/robots.txt).
Also if we use relative paths for _nuxt dir pages render would be broken (as there is no for example /dashboard/stats/_nuxt/1.nuxt.bundle.0cf0418edc2e2a30a9d7.js file).

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danieloprado picture danieloprado  路  3Comments

vadimsg picture vadimsg  路  3Comments

uptownhr picture uptownhr  路  3Comments

nassimbenkirane picture nassimbenkirane  路  3Comments

maicong picture maicong  路  3Comments