ArthurClemens / mithril-vite-starter

Mithril starter template for Vite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mithril Vite Starter

Vite starter template to scaffold a new Mithril project.

This is an unopinionated template; aside from Mithril and Vite, the rest of your project's tools are entirely up to you.

Installation

Pull the template files with degit and install dependencies.

npx degit ArthurClemens/mithril-vite-starter my-project
cd my-project
npm install

npm scripts

  • npm run dev - Starts the development server at port 3000
  • npm run build - Builds the application
  • npm run preview - Serves the build files locally at port 5000

Using JSX

Uncomment the esbuild configuration in vite.config.js.

Example App.jsx:

import m from "mithril";
import "./App.css";

export const App = () => {
  // Local state ...
  return {
    view: () => {
      return (
        <>
         <h1>My Mithril App</h1>
        </>
      )
    },
  };
};

See also

About

Mithril starter template for Vite


Languages

Language:JavaScript 60.4%Language:HTML 35.4%Language:CSS 4.3%