[Vuejs]-VueJS 3 with Pinia without npm

1👍

Most browser/client-side packages you install via npm, you can also find them from unpkg. I see that you’re already using the Vue package from unpkg, so you can use Pinia the same way with the URL: https://unpkg.com/pinia/index.js. The import approach is then just:

import { createPinia, PiniaVuePlugin } from 'https://unpkg.com/pinia/index.js'

Tip: to browse the files of a package via unpkg, use this URL format: https://unpkg.com/browse/<package_name>/, e.g https://unpkg.com/browse/pinia/.
Note that the ending forward slash is important, make sure you don’t leave it out.

Leave a comment