Answer the question
In order to leave comments, you need to log in
How to deploy nuxt static files to cdn?
Hello.
The task is to distribute statics (js files, icons, etc.) of the nuxt project with cdn, so as not to overload your server with requests.
How I think to do it:
After building the project, upload all files from the dist folder (js files, icons, etc.) to cdn, get links, then replay to change links in html like "_nuxt/4fb67d91693190781621.js" to " https://somecdn .com/files/4fb67d91693190781621.js "
i.e. the server will only send html and all scripts and static will be pulled from somecdn.com.
Looks like a crutch to me.
Maybe there is a better solution?
Answer the question
In order to leave comments, you need to log in
There is something here: https://nuxtjs.org/api/configuration-build/#publicpath
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question