GithubHelp home page GithubHelp logo

federicobucchi / grunt-requirejs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from waterfallengineering/grunt-requirejs

0.0 2.0 0.0 84 KB

RequireJs (r.js) plugin for grunt.js

Home Page: http://asciidisco.github.com/grunt-requirejs/

License: MIT License

grunt-requirejs's Introduction

grunt-requirejs Build Status

Optimize require.js based projects

Getting Started

If you haven't used grunt before, be sure to check out the Getting Started guide.

From the same directory as your project's Gruntfile and package.json, install this plugin with the following command:

npm install grunt-requirejs

Once that's done, add this line to your project's Gruntfile:

grunt.loadNpmTasks('grunt-requirejs');

Overview

Inside your grunt.js file add a section named requirejs. This section specifies the options passed to RequireJS Optimizer.

Parameters

options object

This controls how this task (and its helpers) operate and should contain key:value pairs, see options below.

Options

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

Config Example

Example require js optimizer config entry:

  requirejs: {
    compile: {
      options: {
        baseUrl: "path/to/base",
        mainConfigFile: "path/to/config.js",
        out: "path/to/optimized.js"
      }
    }
  }

There is no difference between declaring your require config in your Gruntfile and using a separate requirejs config file.

Almond

grunt-requirejs is capable of replacing require.js with almond.js automatically

For more infos please take a look at the Almond Integration document

Custom builds

grunt-requirejs can generate custom jQuery, Lo-Dash & Backbone.js versions during the optimization

For more infos please take a look at the Using Custom Builds document

Hybrid minification

grunt-requirejs can minify your optimized output files using an hybrid strategy utilitizing uglifyjs & closure compiler

For more infos please take a look at the Using Hybrid Builds document

Using custom r.js versions

grunt-requirejs lets you specify a custom r.js for your build

For more infos please take a look at the Using Custom r.js versions document

Using source maps

grunt-requirejs can generate sourcemaps when using the r.js v2.1.2 or higher

For more infos please take a look at the Using Source Maps document

Examples

There are some project & configuration examples to get you startet:

Release History

Check the Changleog for more information

Contributing

If you like to file an issue or submit a pull request, please check the contributing guidelines

Contributors

Check the AUTHORS File for more information

Resources

License

Copyright (c) 2012 Sebastian Golasch Licensed under the MIT license.

grunt-requirejs's People

Contributors

aaronj1335 avatar asciidisco avatar bernos avatar chrissrogers avatar existentialism avatar indieisaconcept avatar jzaefferer avatar kengotoda avatar lauripiispanen avatar mkuklis avatar podgorniy avatar rodneyrehm avatar sindresorhus avatar svnlto avatar tbassetto avatar tomfuertes avatar

Watchers

 avatar  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.