laurentpayot / vite-plugin-gren

A plugin for Vite enabling you to compile a Gren application/document/element

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vite-plugin-gren

This plugin is based on hmsk/vite-plugin-elm. It enables you to compile a Gren application/document/element on your Vite project. Hot module replacement works roughly in development.

Setup

For now, install the plugin directly from GitHub (works with npm, yarn and pnpm):

npm i -D github:laurentpayot/vite-plugin-gren

Update vite.config.(js|ts):

import { defineConfig } from 'vite'
import grenPlugin from 'vite-plugin-gren'

export default defineConfig({
  plugins: [grenPlugin()]
})

Then you can start Gren in your main Vite script:

import { Gren } from './Main.gren'

// Mount "Hello" Browser.{element,document} on #root
Gren.Main.init({
  node: document.getElementById('root'),
  flags: "Initial Message"
})

See this counter web app example repository to play with an actual Vite project using Gren.

Plugin Options

See the original Elm plugin README.

Acknowledgement

License

MIT

About

A plugin for Vite enabling you to compile a Gren application/document/element

License:Other


Languages

Language:TypeScript 54.3%Language:JavaScript 45.7%