On this page
Practices
Q&A
Since when has the project been progressing?
Work began around September 2023, and by October code containing many bugs had been created in the local environment. Initially, I was creating a compiler as part of creating an animation hook for React.
Compile error
elter uses fs to build css, so it cannot parse imports such as .css and .svg and other image file extention. To deal with this issue, load images via src="".
Do not use simultaneously on css and tsx (separate into ts files, or delete the css import)
elter only compiles ts or tsx files.
This is to minimize build times.
How does elter compile?
elter compile typescript at high speed with "tsx" and build the functions collected with "glob" using "fs".
How does elter hot reloading?
Mainly do hot reloading by injecting styles into the head appropriately, consistently on both the client and server.
The current rendering case like Next.js is special, it provides both a server-side case and a client-side case.
In all other cases short of server-side rendering, only client-side hot reloading works.
This Component trigger hot reload when a link is clicked or mounted or file is saved. The following is included in the ServerCSS component.