https://github.com/noelrohi/mithril-test
https://github.com/noelrohi/mithril-test
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/noelrohi/mithril-test
- Owner: noelrohi
- Created: 2024-07-04T05:40:33.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-07-04T05:43:41.000Z (11 months ago)
- Last Synced: 2024-08-23T03:54:12.415Z (10 months ago)
- Language: TypeScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mithril with TypeScript Vite Starter
[Vite](https://vitejs.dev/) starter template to scaffold a new [Mithril](https://mithril.js.org/) with TypeScript project.
This is an unopinionated template; aside from Mithril, TypeScript and Vite, the rest of your project's tools are entirely up to you.
## Installation
Pull the template files with [degit](https://github.com/Rich-Harris/degit) and install dependencies.
```
npx degit ArthurClemens/mithril-ts-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.tsx`:
```tsx
import m from "mithril";
import "./App.css";export const App = () => {
// Local state ...
return {
view: () => {
return (
<>
My Mithril App
>
);
},
};
};
```## See also
- [Mithril Vite Starter (JavaScript)](https://github.com/ArthurClemens/mithril-vite-starter)