Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

How to include JS from node_modules in Vite in production?

$
0
0

I have a svelte project that uses Vite for its build tooling. I want to import a js file from the sakura-js package and call it in my index.html file. It works locally when I use the script tag like this:

<script src="/node_modules/sakura-js/dist/sakura.min.js"></script>

But in prod, it gives a 404 error trying the script. How do I import the script so it works in prod?


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>