Permalink
Browse files

grunt 0.4 fixes

Not complete, but tested to work with Yeoman
  • Loading branch information...
1 parent 91b7afa commit 15f47c618f7d57d8359cd5544b6ae64123c2d9f4 @sindresorhus sindresorhus committed Feb 22, 2013
Showing with 11 additions and 26 deletions.
  1. +10 −8 package.json
  2. +1 −18 tasks/require.js
View
@@ -20,32 +20,34 @@
"url": "https://github.com/asciidisco/grunt-requirejs/blob/master/LICENSE-MIT"
}
],
- "main": "grunt.js",
+ "main": "Grunfile.js",
"engines": {
"node": ">=0.8.0"
},
"scripts": {
"test": "grunt --verbose"
},
"dependencies": {
- "grunt": "0.4.x",
"requirejs": "2.1.x",
"cheerio": "0.9.2",
"almond": "0.2.x",
"gzip-js": "0.3.x",
"q": "0.8.x",
"temp": "0.4.x",
- "semver": "1.1.x",
"grunt-lodashbuilder": "0.1.x",
"grunt-jquerybuilder": "0.1.x",
"grunt-backbonebuilder": "0.1.x"
},
"devDependencies": {
- "grunt-contrib-clean": "0.3.x",
- "grunt-contrib-copy": "0.3.x",
- "grunt-contrib-jshint": "0.1.x",
- "grunt-contrib-nodeunit": "0.1.x",
- "grunt-contrib-qunit": "0.1.x"
+ "grunt": "~0.4.0",
+ "grunt-contrib-clean": "~0.4.0",
+ "grunt-contrib-copy": "~0.4.0",
+ "grunt-contrib-jshint": "~0.1.1",
+ "grunt-contrib-nodeunit": "~0.1.2",
+ "grunt-contrib-qunit": "~0.1.1"
+ },
+ "peerDependencies": {
+ "grunt": "~0.4.0"
},
"keywords": [
"gruntplugin", "requirejs"
View
@@ -11,9 +11,6 @@ module.exports = function (grunt) {
// External libs.
var Q = require('q');
- var semver = require('semver');
- // TODO: ditch this when grunt 0.4.0 is out
- var util = grunt.util = grunt.util || grunt.utils;
// Path to internal libs
var intLibPath = '../lib/';
@@ -33,28 +30,14 @@ module.exports = function (grunt) {
// each helper runs independent & has no dependencies on the other helpers
grunt.registerMultiTask('requirejs', 'Runs requirejs optimizer', function() {
var done = this.async();
- var config = this.option ? this.option() : this.data;
-
- // Ditch this once grunt 0.4.0 is out
- // Check grunt version, if it´s lower than 0.4,
- // check for the options key & merge
- if (semver.lt(grunt.version, '0.4.0')) {
- if (this.data.options) {
- config = this.data.options;
- }
-
- if (grunt.config.get('requirejs').options) {
- config = util.extend(config, grunt.config.get('requirejs').options);
- }
- }
// The functions only accept the plugin
// config as a parameter & only return the config.
// The functions might modify the config during
// the run or add arbitary data.
// Calls ´done´ when all chain is comletely executed
// Calls the ´errorhandler if an error occures during the build
- Q.fcall(lodashCustomBuilder, config)
+ Q.fcall(lodashCustomBuilder, this.options())
.then(jqueryCustomBuilder)
.then(backboneCustomBuilder)
.then(almondify)

0 comments on commit 15f47c6

Please sign in to comment.