npm.io
0.1.8 • Published 9 years ago

grunt-riot

Licence
MIT
Version
0.1.8
Deps
3
Vulns
0
Weekly
0
Stars
19

grunt-riot

grunt plugin for riot

Build Status

This plugin compile riot's .tag files.

Getting Started

This plugin requires Grunt.

npm install grunt-riot --save-dev

Once that's done, add this line to your project's Gruntfile Or use load-grunt-tasks

grunt.loadNpmTasks('grunt-riot');

Usage Examples

grunt.initConfig({
  riot: {
    options:{
        template : 'jade',
        type : 'coffeescript'
    },
    dist: {
        expand: true,
        cwd: '<%= app %>/scripts',
        src: '**/*.tag',
        dest: '<%= app %>/scripts',
        ext: '.js'
    }
  },
})

if you want concat to a single file , take care not to set expand: true ,eg:

grunt.initConfig({
  riot: {
    options: {
        concat : true
    },
    src: 'script/*.tag',
    dest: '.tmp/tag.js'
  },
})

if you want concat to a single file with AMD and CommonJS support including dependencies , eg:

grunt.initConfig({
  riot: {
    options: {
      concat : true,
      modular: {
        type: 'umd',
        deps: [
          'riot',
          {'jquery': '
Options
  • compact: Boolean
    • no whitespace between tags . eg : ' ' to ''
    • default : true
  • expr: Boolean
    • expressions trough parser
    • default : true
  • type: String
    • javaScript parser type
    • default : null
  • template: String
    • template parser
    • default : null
  • parser: Function
    • custom javascript parser method
    • default : null
  • fileConfig: Function
    • you can set single file compile option in callback
    • default : null
  • concat: Boolean
    • you can concat multiple tag file to a single file
    • default : false
  • modular: Boolean or modularization options:
    • type: amd or common or umd
      • modularization type
      • default : umd
    • deps: Array
      • modularization dependencies
      • default : ['riot']
      • default : false

if you want use typescript , coffee or es , you should install compile module

  • typescript : typescript-simple
  • coffeescript : coffee-script
  • es6 : Babel
  • jade : jade

See more: https://muut.com/riotjs/compiler.html

Release History

2015-01-26 0.0.1

License

Copyright (c) 2015 . Licensed under the MIT license.

}, {'lib/my_module': 'MyModule'} ] } }, src: 'script/*.tag', dest: '.tmp/tag.js' }, })
Options
  • compact: __INLINE_CODE_2__
    • no whitespace between tags . eg : ' ' to ''
    • default : __INLINE_CODE_3__
  • expr: __INLINE_CODE_4__
    • expressions trough parser
    • default : __INLINE_CODE_5__
  • type: __INLINE_CODE_6__
    • javaScript parser type
    • default : __INLINE_CODE_7__
  • template: __INLINE_CODE_8__
    • template parser
    • default : __INLINE_CODE_9__
  • parser: __INLINE_CODE_10__
    • custom javascript parser method
    • default : __INLINE_CODE_11__
  • fileConfig: __INLINE_CODE_12__
    • you can set single file compile option in callback
    • default : __INLINE_CODE_13__
  • concat: __INLINE_CODE_14__
    • you can concat multiple tag file to a single file
    • default : __INLINE_CODE_15__
  • modular: __INLINE_CODE_16__ or modularization options:
    • type: __INLINE_CODE_17__ or __INLINE_CODE_18__ or __INLINE_CODE_19__
      • modularization type
      • default : __INLINE_CODE_20__
    • deps: __INLINE_CODE_21__
      • modularization dependencies
      • default : __INLINE_CODE_22__
      • default : __INLINE_CODE_23__

if you want use typescript , coffee or es , you should install compile module

  • typescript : typescript-simple
  • coffeescript : coffee-script
  • es6 : Babel
  • jade : jade

See more: https://muut.com/riotjs/compiler.html

Release History

2015-01-26 0.0.1

License

Copyright (c) 2015 . Licensed under the MIT license.

Keywords