Skip to content

cyco130/vite-loader-poc

Repository files navigation

Vite Node Loader

This is a proof-of-concept ESM loader that uses Vite to compile modules. It requires this PR so the experiment uses the package @cyco130/vite instead of vite, which is published with the PR merged.

The resolver adds a timestamp so that if a module is imported after a change, a new instance will be created. This is similar to how ssrLoadModule works in Vite.

This is just one possible approach to using Vite in a Node ESM loader. Its advantage is its simplicity, a simple vite dev command can be used to run the server. But it's possible to create the server in a separate process and communicate with it via IPC, for example.

About

A proof-of-concept Node ESM loader using Vite

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published