Git Product home page Git Product logo

grunt-build-requirejs's Introduction

grunt-build-requirejs

Use r.js to build all the require.js projects of a directorys

Getting Started

If you haven't used grunt before, be sure to check out the Getting Started guide, as it explains how to create a gruntfile as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:

npm install grunt-build-requirejs --save-dev

Requirejs task

Run this task with the grunt requirejs command.

This task is a [multi task][] so any targets, files and options should be specified according to the [multi task][] documentation. [multi task]: https://github.com/gruntjs/grunt/wiki/Configuring-tasks

This plugin is compatible with grunt 0.4.0rc7

The plugin will look for the build files and compile them into the specified destination.

Options

For a full list of possible options, see the r.js example build file.

Usage Examples

First possibility: Create a json build file

// path/to/main.build.json
{
    "paths": {
                "dependency": "test-dependency"
            },

    "modules": [{"name": "test1"},{"name": "test2"}]
}

Second possibility: Add a specific extension to identify the files to optimize (In this example .build.js)

// Gruntfile.js
requirejs: {
  compile: {
    options: {
      //common options for all build files
    }
    files:[
        {
            expand: true,
            cwd: root + components,
            src: ['**/*.build.json', '**/*.build.js'],
            dest: root + compiled
        }
    ]
  }
}

Release History

  • 2013-02-17   v0.1.1rc7   Added the possibility to optimize files without .json build file
  • 2013-01-22   v0.1.0rc7   Creation of the plugin, work with grunt 0.4.0rc7

grunt-build-requirejs's People

Watchers

James Cloos avatar Aaron M. avatar

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.