Relative Content

Tag Archive for vite

how to create multiple html files with vite?

I’m having a hard time trying to use vite. I have 2 html files and I would like to generate them with the imports automatically. However I’ve been able to do only one. I’m trying to import tachyons.css for all the pages right? That I could do it. but I also wanna create specific scripts for each page I don’t know how to config to set automatically. Not even compile it.

how to dynamic import a big util in vite

in my app, i use highlight.js to render my page, but this util is too heavy, so i need to use dynamic import to prevent it to block my page appear, i do it like this:

but when i deploy my app , i found that this util still load in my home page, though i doesn’t use it in my homepage: i feel very sad about this, so i ask for help

Import local assets using vite inside external library

I am building a library for a Website with Typescript and vite that exports one Main class. That class needs a Json file for the constructor and that Json file includes multiple URLs to assets like Images or Videos. These URLs are imported using this bit of code for further Processing inside the library:

Very verbose output from vite build

Does anyone recognise this output from vite build? I’m getting hundreds of lines like this and the build seems to have slowed considerably because of it. I’m pretty sure it’s linked to my updating vite, today, from 4.5 to 5.3.3.

Build problem, ignoring base paramtere after multiple input file

My problem is that when I build a single file, it handles the URL specified in the “base” parameter perfectly. However, when I build two files, each including a file named “core.js” it seems like the “base” parameter is not used. The “modulepreload” disappears from the built files. (e.g.: const scriptRel=”modulepreload”,assetsURL=function(e){return”http://localhost.test/build/”+e%7D)