A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/riot/riotify/tree/v3 below:

GitHub - riot/riotify at v3

"riotify" is a browserify transformer for riot ".tag" files.

This module is meant to be used together with browserify or module-deps:

Either of the two commands below result creates the same result:

$ browserify -t riotify app.js
$ module-deps -t riotify app.js | browser-pack

Example app.js:

var riot = require('riot')
var todo = require('./todo.tag')
riot.mount(todo)

Example todo.tag:

<todo>
  <div each={ items }>
    <h3>{ title }</h3>
  </div>

  // a tag file can contain any JavaScript, even require()
  var resources = require('../resources.json')
  this.items = [ { title: resources.en.first }, { title: resources.en.second } ]
</todo>

Note that your tag files actually need to have the extension ".tag".

This plugin can give riot's compile options.

$ browserify -t [ riotify --type coffeescript --template jade ] app.js

You can also configure it in package.json

{
    "name": "my-package",
    "browserify": {
        "transform": [
            [ "riotify", {"type": "coffeescript", "template": "jade" } ],
        ]
    }
}

See more: https://github.com/riot/compiler

var gulp       = require('gulp');
var browserify = require('browserify');
var riotify    = require('riotify');
var source     = require('vinyl-source-stream');

gulp.task('browserify', function(){
  browserify({ entries: ['src/app.js'] })
  .transform(riotify, { template: 'jade' }) // pass options if you need
  .bundle()
  .pipe(source('app.js'))
  .pipe(gulp.dest('dist/'))
});

These are the simplest cases. uglify and sourcemaps would be needed.

Jan Henning Thorsen - jhthorsen@cpan.org


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