https://github.com/spacejack/mithril-browserify-ts-budo
Mithril, Browserify-HMR, TS, Budo, PostCSS starter project
https://github.com/spacejack/mithril-browserify-ts-budo
browserify mithriljs postcss typescript
Last synced: 2 months ago
JSON representation
Mithril, Browserify-HMR, TS, Budo, PostCSS starter project
- Host: GitHub
- URL: https://github.com/spacejack/mithril-browserify-ts-budo
- Owner: spacejack
- Created: 2017-05-08T19:24:00.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T16:12:12.000Z (over 2 years ago)
- Last Synced: 2024-04-14T21:52:36.141Z (about 1 year ago)
- Topics: browserify, mithriljs, postcss, typescript
- Language: TypeScript
- Size: 997 KB
- Stars: 19
- Watchers: 3
- Forks: 3
- Open Issues: 14
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- awesome-mithril - Mithril/Typescript/PostCSS/Browserify/HMR/Budō
README
# Mithril / Typescript / Browserify / HMR / Budō
This is a starter project for [Mithril](https://mithril.js.org/), Typescript, Browserify with hot-module-replacement and [Budō](https://github.com/mattdesl/budo) local dev server for hot CSS reloading.
This project also uses PostCSS for CSS compilation.
This repo also contains a branch that performs code-splitting (separating your app and vendor bundles.)
git checkout code-split
And a Babel branch for plain ES20XX instead of Typescript.
git checkout babel
Note that each branch has different npm dependencies so you will need to run `npm install` for the branch you want to use.
## Install
npm install
### Recommended VSCode Extensions
* tslint
* eslint
* stylelint
* postcss-sugarss-language
* EditorConfig(Or equivalents for your preferred editor/IDE.)
## Run & Develop
npm start
Then go to http://localhost:3000 in your browser
## Build Minified
npm run build
Outputs compiled JS to `public/js` and CSS to `public/css`.
---
## Using this repo to start your own project
To use this repo to create your own project follow these steps.
1 - Clone this repo into a directory with a custom name (eg. `your-project-name` instead of the default `mithril-browserify-ts-budo`)
```
git clone https://github.com/spacejack/mithril-browserify-ts-budo.git your-project-name
```2 - `cd` into this new directory
```
cd your-project-name
```3 - Remove the `.git` directory so it is no longer linked to this repo:
```
rm -fr .git
```4 - Initialize it as a new git repo and point it at your own remote (assumes you've created one on Github, Bitbucket, Gitlab, etc.):
```
git init
git remote add origin
git add .
git commit -m "Initial commit"
git push -u origin master
```Now you can follow the [install](#install) instructions above.
---
For a more barebones Mithril/Typescript example (no PostCSS, no live-reload/HMR) take a look at [this repo](https://github.com/spacejack/mithril-ts-example).