1

I have a Nuxt.js project and I generate a static app. I need to put it in a subdirectory on ftp, but I can't make it work.

I've set router.base to /subfolder and that works fine for _nuxt, but static files are still using absolute path /img/...

So I've tried to put my static files into assets/img/, but they are not getting loaded from scss when I use ~assets/img/...

I've read many topics, but couldn't find the solution.
Any ideas?

Thank you

1 Answer 1

2

I had trouble finding solutions in the documentation as well, but I found out you can use the static folder on a subdomain if the links are changed from:

/image.jpg

to:

~/static/image.jpg

Also if it helps, I believe changing:

~assets/image.jpg

to

~/assets/image.jpg

Might solve your issue?

Sign up to request clarification or add additional context in comments.

2 Comments

I also tried to set router base to "." and that works well for templates, but css gets the path wrong. Like /.nuxt/.nuxt/... In css you can only use ~assets, nothing else works. I read quite a few posts about it, but found no solution. Thank you anyways
Yeah coming back to this question, I ran into the same issue. Never found an alternative answer either :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.