Qwik integration not working in production
following the qwik integration guide in preline website and adding this script tag to root.tsx
<script src="../assets/vendor/preline/preline.js"></script>
results in a not found error when it tries looking for the provided location in dev and prod
i way around this is using <script src="../node_modules/preline/preline.js"></script> instead, however that only works in dev
in prod i get this Failed to load resource: the server responded with a status of 404 (Not Found)
i would like to know if there's a workaround i could use to be able to actually use preline in my qwik project as the library looks fantastic
also tried the way it is in the stackblitz qwik repo with
<script src="/node_modules/preline/preline.js"></script> but that dioesnt work in prod either
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/preline.min.js"></script>
Add the above script inside your body tag.
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/preline.min.js"></script>Add the above script inside your body tag.
won't this just download all of the preline javascript weather the client needs it or not? it seems like a big sacrifice no?
okey so after some research and asking the qwik community, the proper way to import preline scripts is like this
import PrelineUI from "../node_modules/preline/preline.js?raw";```
//
//
//
<script dangerouslySetInnerHTML={PrelineUI as any} />