mithrilify
Browserify transform for converting Mithril view templates using MSX
Install
$ npm install --save-dev mithrilify
Usage
Example of a Mithril view template.
It can be defined within a *.js
or *.msx
file and
should include /** @jsx m */
at the top.
'use strict'; var { return <div> hello </div>;}; moduleexports = View;
Command line:
$ browserify -t mithrilify ./view.js > ./bundle.js
Gulp and gulp-browserify
var gulp = ; browserify = rename = ; gulp;
Grunt and grunt-browserify
browserify: dist: files: 'build/bundle.js': 'app/scripts/view.js' options: transform: 'mithrilify'
Output:
'use strict'; var { return tag: "div" attrs: {} children: "hello" ;};moduleexports = View;
Test
Clone project:
$ git clone https://github.com/sectore/mithrilify.git && cd $_
Install dependencies (only once):
$ npm install
Run tests:
$ gulp test
Credits:
- MSX for supporting JSX to Mithril
- generator-node-gulp to create a Node.js module with yo, including gulp and Mocha unit tests.
Contributors
Release History
License
Copyright (c) 2015 Jens Krause. Licensed under the MIT license.