Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dario-piotrowicz/vite-runtime-5.1-experimentations


https://github.com/dario-piotrowicz/vite-runtime-5.1-experimentations

Last synced: 8 days ago
JSON representation

Awesome Lists containing this project

README

        

> [!WARNING]
> The Vite Runtime API has been replaced with the new [Vite Environment API](https://deploy-preview-16471--vite-docs-main.netlify.app/guide/api-vite-environment.html), the experimentations here are therefore
> outdated, a followup of these using the new API can be found at https://github.com/dario-piotrowicz/vite-environment-6.0.0-alpha-experimentations.

# Vite Runtime 5.1 experimentations

Experimentations based on the [_experimental_ Vite Runtime API](https://vitejs.dev/guide/api-vite-runtime) introduced in Vite 5.1

## Setup

Simply run:

```sh
$ pnpm i
```

to install all the dependencies and build all the packages in this repository

You can then go to:

```
examples/example-framework
```

and run

```sh
$ pnpm dev:node
```

to run the example using a vm Node.js based runtime

or

```sh
$ pnpm dev:workerd
```

to run the example using the Workerd runtime instead

## Monorepo Structure

- `packages`

Basically contains plugins that using the Vite Runtime API allow to run code in Alternative JS Runtimes

- `examples`

Contains examples of usages of the above mentioned runtime packages

> [!NOTE]
> All the packages and examples have their own README files briefly explaining the package/example

## Credits & References

- [**vite-node-miniflare** (by _hi-ogawa_)](https://github.com/hi-ogawa/vite-plugins/blob/ba5d995046cffc0fd368dd3c3a4d05f9d2db29dc/packages/vite-node-miniflare)
- [**vite-envs** (by _sapphi-red_)](https://github.com/sapphi-red/vite-envs/tree/7f76892b7d28f0da06826f43953cedb5b2f042c5)
- [**hydrogen vite** (by _frandiox_)](https://github.com/Shopify/hydrogen/pull/1728)