Code Monkey home page Code Monkey logo

grunt-riot's Introduction

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': '$'},
          {'lib/my_module': 'MyModule'}
        ]
      }
    },
    src: 'script/*.tag',
    dest: '.tmp/tag.js'
  },
})

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.

grunt-riot's People

Contributors

ariesjia avatar ashbrener avatar

Watchers

 avatar  avatar

Forkers

isabella232

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.