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.
Pull the template files with degit and install dependencies.
npx degit ArthurClemens/mithril-vite-starter my-project
cd my-project
npm install
npm run dev
- Starts the development server at port 3000npm run build
- Builds the applicationnpm run preview
- Serves the build files locally at port 5000
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>
</>
)
},
};
};