T
T
Tash1moto2019-10-07 14:56:30
Software Deployment
Tash1moto, 2019-10-07 14:56:30

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

1 answer(s)
A
Anton Anton, 2019-10-07
@Tash1moto

There is something here: https://nuxtjs.org/api/configuration-build/#publicpath

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question