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.
How to add simple JSON API to Vite?
I just need to return simple JSON response for /api/status
: { "ok": true }
How to make Vite to generate native ES modules?
The export const some = 1
compiled by vite into ... exports.some = some; ...
.
How to bundle but keep exports in Vite?
I have library called lib.ts
, it’s made from multiple files, like lib/part1.ts
, lib/part2.ts
.
How to merge modules but keep exports in Vite?
I have library called lib.ts
, it’s made from multiple files, like lib/part1.ts
, lib/part2.ts
.
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)
Configure @nx/vite:test executor’s reportsDirectory by using {workspaceRoot}/coverage/{projectRoot}
I wanna use {workspaceRoot} and {projectRoot} in vite executor reportsDirectory
configuration like this:
Vite – Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist
I have this problem when using Vite.
I get this message on the console.
[These are the folders] (https://i.sstatic.net/nK8XtQPN.png)