Browserify transform for converting Mithril view templates using MSX
$ npm install --save-dev mithrilifyExample 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 View = function (ctrl) { return <div> hello </div>; }; module.exports = View;
$ browserify -t mithrilify ./view.js > ./bundle.js
var gulp = require('gulp'); browserify = require('gulp-browserify'), rename = require('gulp-rename'); gulp.task('bundle', function() { gulp.src('app/scripts/view.js') .pipe(browserify({ transform: ['mithrilify'] })) .pipe(rename('bundle.js')) .pipe(gulp.dest('build/')) });
browserify: { dist: { files: { 'build/bundle.js': 'app/scripts/view.js', }, options: { transform: ['mithrilify'] } } }
'use strict'; var View = function (ctrl) { return {tag: "div", attrs: {}, children: [ "hello" ]}; }; module.exports = View;
Clone project:
$ git clone https://github.com/sectore/mithrilify.git && cd $_
Install dependencies (only once):
Run tests:
Copyright (c) 2015 Jens Krause. Licensed under the MIT license.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4