Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Example projects now run on grunt 0.4; some fixes in the require task…

… itself
  • Loading branch information...
commit 2cbaed75e3b10034ee8ed56c45dc3a4bc9e8590c 1 parent eb6841d
@asciidisco authored
View
4 .gitignore
@@ -1,6 +1,10 @@
/node_modules/
/examples/libglobal/dist/
+/examples/libglobal-hybrid/dist/
/examples/multipage/www-built/
/examples/multipage-shim/www-built/
/examples/libglobal/node_modules/
+/examples/libglobal-hybrid/node_modules/
+/examples/multipage/node_modules/
+/examples/multipage-shim/node_modules/
.DS_Store
View
5 .travis.yml
@@ -1,3 +1,6 @@
language: node_js
node_js: 0.8
-before_script: "npm install"
+
+before_script:
+ - npm install -g grunt-cli
+ - npm install
View
28 Gruntfile.js
@@ -61,16 +61,12 @@ module.exports = function(grunt) {
}
},
- test: {
- files: ['test/*_test.js']
+ nodeunit: {
+ all: ['test/*_test.js']
},
qunit: {
- files: ['examples/**/tests/*.html']
- },
-
- lint: {
- files: ['grunt.js', 'tasks/**/*.js', 'test/require_test.js', 'lib/**/*.js']
+ all: ['examples/**/tests/*.html']
},
watch: {
@@ -91,13 +87,14 @@ module.exports = function(grunt) {
boss: true,
eqnull: true,
node: true,
- es5: true
+ es5: true,
+ globals: {
+ exports: true,
+ require: true,
+ module: true
+ },
},
- globals: {
- exports: true,
- require: true,
- module: true
- }
+ all: ['grunt.js', 'tasks/**/*.js', 'test/require_test.js', 'lib/**/*.js']
}
});
@@ -164,10 +161,13 @@ module.exports = function(grunt) {
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-nodeunit');
+ grunt.loadNpmTasks('grunt-contrib-qunit');
// Setup the test environment task.
grunt.registerTask('setUp', ['buildExampleProjects', 'copy', 'requirejs']);
// Default task.
- grunt.registerTask('default', ['setUp', 'lint', 'test', 'qunit', 'clean']);
+ grunt.registerTask('default', ['setUp', 'jshint', 'nodeunit', 'qunit', 'clean']);
};
View
60 examples/libglobal-hybrid/Gruntfile.js
@@ -0,0 +1,60 @@
+/*global module:false*/
+module.exports = function(grunt) {
+
+ grunt.initConfig({
+
+ qunit: {
+ all: ["tests/*.html"]
+ },
+
+ requirejs: {
+ std: {
+ options: {
+ almond: true,
+ baseUrl: 'lib',
+ paths: {
+ principium: '../principium'
+ },
+ include: ['principium'],
+ exclude: ['jquery', 'underscore'],
+ out: 'dist/principium.js',
+ optimize: 'hybrid',
+ wrap: {
+ startFile: 'wrap/wrap.start',
+ endFile: 'wrap/wrap.end'
+ }
+ }
+ }
+ },
+
+ jshint: {
+ options: {
+ curly: true,
+ eqeqeq: true,
+ immed: true,
+ latedef: true,
+ newcap: true,
+ noarg: true,
+ sub: true,
+ undef: true,
+ eqnull: true,
+ browser: true,
+ nomen: true,
+ globals: {
+ define: true
+ }
+ },
+ all: ['principium/*.js', 'principium.js']
+ }
+ });
+
+ // replace this line with
+ // grunt.loadNpmTasks("require-js");
+ // if you use this example standalone
+ grunt.loadTasks('../../tasks');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-qunit');
+
+ grunt.registerTask('default', ['jshint', 'qunit']);
+ grunt.registerTask('build', 'requirejs');
+};
View
4 examples/libglobal-hybrid/dist/principium.js
@@ -1,9 +1,9 @@
//Copyright 2012, etc.
/**
- * almond 0.2.1 Copyright (c) 2011-2012, The Dojo Foundation All Rights Reserved.
+ * almond 0.2.3 Copyright (c) 2011-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/almond for details
*/
-(function(e,t){typeof define=="function"&&define.amd?define(["jquery","underscore"],t):e.principium=t(e.$,e._)})(this,function(e,t){var n,r,i;return function(e){function d(e,t){return h.call(e,t)}function v(e,t){var n,r,i,s,o,u,a,f,c,h,p=t&&t.split("/"),d=l.map,v=d&&d["*"]||{};if(e&&e.charAt(0)==="."&&t){p=p.slice(0,p.length-1),e=p.concat(e.split("/"));for(f=0;f<e.length;f+=1){h=e[f];if(h===".")e.splice(f,1),f-=1;else if(h===".."){if(f===1&&(e[2]===".."||e[0]===".."))break;f>0&&(e.splice(f-1,2),f-=2)}}e=e.join("/")}if((p||v)&&d){n=e.split("/");for(f=n.length;f>0;f-=1){r=n.slice(0,f).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){s=i,o=f;break}}}if(s)break;!u&&v&&v[r]&&(u=v[r],a=f)}!s&&u&&(s=u,o=a),s&&(n.splice(0,o,s),e=n.join("/"))}return e}function m(t,n){return function(){return s.apply(e,p.call(arguments,0).concat([t,n]))}}function g(e){return function(t){return v(t,e)}}function y(e){return function(t){a[e]=t}}function b(n){if(d(f,n)){var r=f[n];delete f[n],c[n]=!0,t.apply(e,r)}if(!d(a,n)&&!d(c,n))throw new Error("No "+n);return a[n]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return function(){return l&&l.config&&l.config[e]||{}}}var t,s,o,u,a={},f={},l={},c={},h=Object.prototype.hasOwnProperty,p=[].slice;o=function(e,t){var n,r=w(e),i=r[0];return e=r[1],i&&(i=v(i,t),n=b(i)),i?n&&n.normalize?e=n.normalize(e,g(t)):e=v(e,t):(e=v(e,t),r=w(e),i=r[0],e=r[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},u={require:function(e){return m(e)},exports:function(e){var t=a[e];return typeof t!="undefined"?t:a[e]={}},module:function(e){return{id:e,uri:"",exports:a[e],config:E(e)}}},t=function(t,n,r,i){var s,l,h,p,v,g=[],w;i=i||t;if(typeof r=="function"){n=!n.length&&r.length?["require","exports","module"]:n;for(v=0;v<n.length;v+=1){p=o(n[v],i),l=p.f;if(l==="require")g[v]=u.require(t);else if(l==="exports")g[v]=u.exports(t),w=!0;else if(l==="module")s=g[v]=u.module(t);else if(d(a,l)||d(f,l)||d(c,l))g[v]=b(l);else{if(!p.p)throw new Error(t+" missing "+l);p.p.load(p.n,m(i,!0),y(l),{}),g[v]=a[l]}}h=r.apply(a[t],g);if(t)if(s&&s.exports!==e&&s.exports!==a[t])a[t]=s.exports;else if(h!==e||!w)a[t]=h}else t&&(a[t]=r)},n=r=s=function(n,r,i,a,f){return typeof n=="string"?u[n]?u[n](r):b(o(n,r).f):(n.splice||(l=n,r.splice?(n=r,r=i,i=null):n=e),r=r||function(){},typeof i=="function"&&(i=a,a=f),a?t(e,n,r,i):setTimeout(function(){t(e,n,r,i)},15),s)},s.config=function(e){return l=e,s},i=function(e,t,n){t.splice||(n=t,t=[]),d(a,e)||(f[e]=[e,t,n])},i.amd={jQuery:!0}}(),i("almond",function(){}),i("principium/convert",["underscore"],function(e){function t(t){return e.escape(t)}return t}),i("principium",["require","jquery","principium/convert"],function(e){var t=e("jquery"),n=e("principium/convert");return{version:"0.0.1, jQuery version is: "+t.fn.jquery,convert:n}}),i("jquery",function(){return e}),i("underscore",function(){return t}),r("principium")});
+(function(e,t){typeof define=="function"&&define.amd?define(["jquery","underscore"],t):e.principium=t(e.$,e._)})(this,function(e,t){var n,r,i;return function(e){function d(e,t){return h.call(e,t)}function v(e,t){var n,r,i,s,o,u,a,f,c,h,p=t&&t.split("/"),d=l.map,v=d&&d["*"]||{};if(e&&e.charAt(0)===".")if(t){p=p.slice(0,p.length-1),e=p.concat(e.split("/"));for(f=0;f<e.length;f+=1){h=e[f];if(h===".")e.splice(f,1),f-=1;else if(h===".."){if(f===1&&(e[2]===".."||e[0]===".."))break;f>0&&(e.splice(f-1,2),f-=2)}}e=e.join("/")}else e.indexOf("./")===0&&(e=e.substring(2));if((p||v)&&d){n=e.split("/");for(f=n.length;f>0;f-=1){r=n.slice(0,f).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){s=i,o=f;break}}}if(s)break;!u&&v&&v[r]&&(u=v[r],a=f)}!s&&u&&(s=u,o=a),s&&(n.splice(0,o,s),e=n.join("/"))}return e}function m(t,n){return function(){return s.apply(e,p.call(arguments,0).concat([t,n]))}}function g(e){return function(t){return v(t,e)}}function y(e){return function(t){a[e]=t}}function b(n){if(d(f,n)){var r=f[n];delete f[n],c[n]=!0,t.apply(e,r)}if(!d(a,n)&&!d(c,n))throw new Error("No "+n);return a[n]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return function(){return l&&l.config&&l.config[e]||{}}}var t,s,o,u,a={},f={},l={},c={},h=Object.prototype.hasOwnProperty,p=[].slice;o=function(e,t){var n,r=w(e),i=r[0];return e=r[1],i&&(i=v(i,t),n=b(i)),i?n&&n.normalize?e=n.normalize(e,g(t)):e=v(e,t):(e=v(e,t),r=w(e),i=r[0],e=r[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},u={require:function(e){return m(e)},exports:function(e){var t=a[e];return typeof t!="undefined"?t:a[e]={}},module:function(e){return{id:e,uri:"",exports:a[e],config:E(e)}}},t=function(t,n,r,i){var s,l,h,p,v,g=[],w;i=i||t;if(typeof r=="function"){n=!n.length&&r.length?["require","exports","module"]:n;for(v=0;v<n.length;v+=1){p=o(n[v],i),l=p.f;if(l==="require")g[v]=u.require(t);else if(l==="exports")g[v]=u.exports(t),w=!0;else if(l==="module")s=g[v]=u.module(t);else if(d(a,l)||d(f,l)||d(c,l))g[v]=b(l);else{if(!p.p)throw new Error(t+" missing "+l);p.p.load(p.n,m(i,!0),y(l),{}),g[v]=a[l]}}h=r.apply(a[t],g);if(t)if(s&&s.exports!==e&&s.exports!==a[t])a[t]=s.exports;else if(h!==e||!w)a[t]=h}else t&&(a[t]=r)},n=r=s=function(n,r,i,a,f){return typeof n=="string"?u[n]?u[n](r):b(o(n,r).f):(n.splice||(l=n,r.splice?(n=r,r=i,i=null):n=e),r=r||function(){},typeof i=="function"&&(i=a,a=f),a?t(e,n,r,i):setTimeout(function(){t(e,n,r,i)},15),s)},s.config=function(e){return l=e,s},i=function(e,t,n){t.splice||(n=t,t=[]),!d(a,e)&&!d(f,e)&&(f[e]=[e,t,n])},i.amd={jQuery:!0}}(),i("almond",function(){}),i("principium/convert",["underscore"],function(e){function t(t){return e.escape(t)}return t}),i("principium",["require","jquery","principium/convert"],function(e){var t=e("jquery"),n=e("principium/convert");return{version:"0.0.1, jQuery version is: "+t.fn.jquery,convert:n}}),i("jquery",function(){return e}),i("underscore",function(){return t}),r("principium")});
View
61 examples/libglobal-hybrid/grunt.js
@@ -1,61 +0,0 @@
-/*global module:false*/
-module.exports = function(grunt) {
-
- // replace this line with
- // grunt.loadNpmTasks("require-js");
- // if you use this example standalone
- grunt.loadTasks("../../tasks");
-
- grunt.initConfig({
-
- lint: {
- files: ["principium/*.js", "principium.js"]
- },
-
- qunit: {
- files: ["tests/*.html"]
- },
-
- requirejs: {
- std: {
- options: {
- almond: true,
- baseUrl: "lib",
- paths: {
- principium: "../principium"
- },
- include: ["principium"],
- exclude: ["jquery", "underscore"],
- out: "dist/principium.js",
- optimize: "hybrid",
- wrap: {
- startFile: "wrap/wrap.start",
- endFile: "wrap/wrap.end"
- }
- }
- }
- },
-
- jshint: {
- options: {
- curly: true,
- eqeqeq: true,
- immed: true,
- latedef: true,
- newcap: true,
- noarg: true,
- sub: true,
- undef: true,
- eqnull: true,
- browser: true,
- nomen: true
- },
- globals: {
- define: true
- }
- }
- });
-
- grunt.registerTask('default', 'lint qunit');
- grunt.registerTask('build', 'requirejs');
-};
View
10 examples/libglobal-hybrid/package.json
@@ -1,5 +1,5 @@
{
- "name": "grunt-requirejs-libglobal-example",
+ "name": "grunt-requirejs-libglobalhybrid-example",
"version": "0.1.0",
"engines": {
"node": ">=0.6.0"
@@ -9,8 +9,10 @@
"test": "grunt qunit"
},
"dependencies": {
- "grunt": ">=0.3.15",
- "grunt-requirejs": ">=0.2.10"
+ "grunt": "0.4.x",
+ "grunt-requirejs": "0.3.x",
+ "grunt-contrib-jshint": "0.1.x",
+ "grunt-contrib-qunit": "0.1.x"
},
"amd": {},
"volo": {
@@ -20,4 +22,4 @@
"underscore": "github:amdjs/underscore/1.3.3"
}
}
-}
+}
View
90 examples/multipage-shim/Gruntfile.js
@@ -0,0 +1,90 @@
+/*global module:false*/
+module.exports = function(grunt) {
+
+ grunt.initConfig({
+
+ requirejs: {
+ std: {
+ options: {
+ appDir: 'www',
+ mainConfigFile: '/www/js/common.js',
+ dir: 'www-built',
+ modules: [
+ //First set up the common build layer.
+ {
+ //module names are relative to baseUrl
+ name: '../common',
+ //List common dependencies here. Only need to list
+ //top level dependencies, "include" will find
+ //nested dependencies.
+ include: [
+ 'jquery',
+ 'app/lib',
+ 'app/controller/Base',
+ 'app/model/Base'
+ ]
+ },
+ //Now set up a build layer for each main layer, but exclude
+ //the common one. "exclude" will exclude nested
+ //the nested, built dependencies from "common". Any
+ //"exclude" that includes built modules should be
+ //listed before the build layer that wants to exclude it.
+ //The "page1" and "page2" modules are **not** the targets of
+ //the optimization, because shim config is in play, and
+ //shimmed dependencies need to maintain their load order.
+ //In this example, common.js will hold jquery, so backbone
+ //needs to be delayed from loading until common.js finishes.
+ //That loading sequence is controlled in page1.js.
+ {
+ //module names are relative to baseUrl/paths config
+ name: 'app/main1',
+ exclude: ['../common']
+ },
+
+ {
+ //module names are relative to baseUrl
+ name: 'app/main2',
+ exclude: ['../common']
+ }
+ ]
+ }
+ }
+ },
+
+ jshint: {
+ options: {
+ curly: true,
+ eqeqeq: true,
+ immed: true,
+ latedef: true,
+ newcap: true,
+ noarg: true,
+ sub: true,
+ undef: true,
+ eqnull: true,
+ browser: true,
+ nomen: true,
+ globals: {
+ define: true,
+ requirejs: true,
+ require: true
+ }
+ },
+ all: ['www/js/app/*.js', 'www/js/common.js', 'www/js/page1.js', 'www/js/page2.js']
+ },
+
+ qunit: {
+ all: ['tests/*.html']
+ }
+ });
+
+ // replace this line with
+ // grunt.loadNpmTasks("require-js");
+ // if you use this example standalone
+ grunt.loadTasks("../../tasks");
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-qunit');
+
+ grunt.registerTask('default', ['jshint', 'qunit']);
+ grunt.registerTask('build', 'requirejs');
+};
View
88 examples/multipage-shim/grunt.js
@@ -1,88 +0,0 @@
-/*global module:false*/
-module.exports = function(grunt) {
-
- // replace this line with
- // grunt.loadNpmTasks("require-js");
- // if you use this example standalone
- grunt.loadTasks("../../tasks");
-
- grunt.initConfig({
-
- lint: {
- files: ["www/js/app/*.js", "www/js/common.js", "www/js/page1.js", "www/js/page2.js"]
- },
-
- qunit: {
- files: ["tests/*.html"]
- },
-
- requirejs: {
- std: {
- appDir: "www",
- mainConfigFile: "/www/js/common.js",
- dir: "www-built",
- modules: [
- //First set up the common build layer.
- {
- //module names are relative to baseUrl
- name: "../common",
- //List common dependencies here. Only need to list
- //top level dependencies, "include" will find
- //nested dependencies.
- include: [
- "jquery",
- "app/lib",
- "app/controller/Base",
- "app/model/Base"
- ]
- },
- //Now set up a build layer for each main layer, but exclude
- //the common one. "exclude" will exclude nested
- //the nested, built dependencies from "common". Any
- //"exclude" that includes built modules should be
- //listed before the build layer that wants to exclude it.
- //The "page1" and "page2" modules are **not** the targets of
- //the optimization, because shim config is in play, and
- //shimmed dependencies need to maintain their load order.
- //In this example, common.js will hold jquery, so backbone
- //needs to be delayed from loading until common.js finishes.
- //That loading sequence is controlled in page1.js.
- {
- //module names are relative to baseUrl/paths config
- name: "app/main1",
- exclude: ["../common"]
- },
-
- {
- //module names are relative to baseUrl
- name: "app/main2",
- exclude: ["../common"]
- }
-
- ]
- }
- },
-
- jshint: {
- options: {
- curly: true,
- eqeqeq: true,
- immed: true,
- latedef: true,
- newcap: true,
- noarg: true,
- sub: true,
- undef: true,
- eqnull: true,
- browser: true,
- nomen: true
- },
- globals: {
- define: true
- }
- }
- });
-
- grunt.registerTask('default', 'lint qunit');
- grunt.registerTask('build', 'requirejs');
-};
View
15 examples/multipage-shim/package.json
@@ -1,4 +1,19 @@
{
+ "name": "grunt-requirejs-multipageshim-example",
+ "version": "0.1.0",
+ "engines": {
+ "node": ">=0.6.0"
+ },
+ "scripts": {
+ "build": "grunt build",
+ "test": "grunt qunit"
+ },
+ "dependencies": {
+ "grunt": "0.4.x",
+ "grunt-requirejs": "0.3.x",
+ "grunt-contrib-jshint": "0.1.x",
+ "grunt-contrib-qunit": "0.1.x"
+ },
"amd": {},
"volo": {
"baseUrl": "www/js/lib",
View
2  examples/multipage-shim/www/js/app/lib.js
@@ -3,5 +3,5 @@ define(['jquery'], function ($) {
getBody: function () {
return $('body');
}
- }
+ };
});
View
91 examples/multipage/Gruntfile.js
@@ -0,0 +1,91 @@
+/*global module:false*/
+module.exports = function(grunt) {
+
+ grunt.initConfig({
+
+ requirejs: {
+ std: {
+ options: {
+ appDir: 'www',
+ baseUrl: 'js/lib',
+ paths: {
+ app: '../app'
+ },
+ dir: 'www-built',
+ modules: [
+ //First set up the common build layer.
+ {
+ //module names are relative to baseUrl
+ name: '../common',
+ //List common dependencies here. Only need to list
+ //top level dependencies, "include" will find
+ //nested dependencies.
+ include: [
+ 'jquery',
+ 'app/lib',
+ 'app/controller/Base',
+ 'app/model/Base'
+ ]
+ },
+ //Now set up a build layer for each page, but exclude
+ //the common one. "exclude" will exclude nested
+ //the nested, built dependencies from "common". Any
+ //"exclude" that includes built modules should be
+ //listed before the build layer that wants to exclude it.
+ //"include" the appropriate "app/main*" module since by default
+ //it will not get added to the build since it is loaded by a nested
+ //require in the page*.js files.
+ {
+ //module names are relative to baseUrl/paths config
+ name: '../page1',
+ include: ['app/main1'],
+ exclude: ['../common']
+ },
+ {
+ //module names are relative to baseUrl
+ name: "../page2",
+ include: ["app/main2"],
+ exclude: ["../common"]
+ }
+ ]
+ }
+ }
+ },
+
+ jshint: {
+ options: {
+ curly: true,
+ eqeqeq: true,
+ immed: true,
+ latedef: true,
+ newcap: true,
+ noarg: true,
+ sub: true,
+ undef: true,
+ eqnull: true,
+ browser: true,
+ nomen: true,
+ globals: {
+ define: true,
+ requirejs: true,
+ require: true
+ }
+ },
+ all: ['www/js/app/*.js', 'www/js/common.js', 'www/js/page1.js', 'www/js/page2.js']
+ },
+
+ qunit: {
+ all: ['tests/index.html']
+ }
+ });
+
+ // replace this line with
+ // grunt.loadNpmTasks("require-js");
+ // if you use this example standalone
+ grunt.loadTasks("../../tasks");
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-qunit');
+
+ grunt.registerTask('default', ['jshint', 'qunit']);
+ grunt.registerTask('build', 'requirejs');
+};
View
91 examples/multipage/grunt.js
@@ -1,91 +0,0 @@
-/*global module:false*/
-module.exports = function(grunt) {
-
- // replace this line with
- // grunt.loadNpmTasks("require-js");
- // if you use this example standalone
- grunt.loadTasks("../../tasks");
-
- grunt.initConfig({
-
- lint: {
- files: ["www/js/app/*.js", "www/js/common.js", "www/js/page1.js", "www/js/page2.js"]
- },
-
- qunit: {
- files: ["tests/index.html"]
- },
-
- requirejs: {
- std: {
- options: {
- appDir: "www",
- baseUrl: "js/lib",
- paths: {
- app: "../app"
- },
- dir: "www-built",
- modules: [
- //First set up the common build layer.
- {
- //module names are relative to baseUrl
- name: "../common",
- //List common dependencies here. Only need to list
- //top level dependencies, "include" will find
- //nested dependencies.
- include: ["jquery",
- "app/lib",
- "app/controller/Base",
- "app/model/Base"
- ]
- },
-
- //Now set up a build layer for each page, but exclude
- //the common one. "exclude" will exclude nested
- //the nested, built dependencies from "common". Any
- //"exclude" that includes built modules should be
- //listed before the build layer that wants to exclude it.
- //"include" the appropriate "app/main*" module since by default
- //it will not get added to the build since it is loaded by a nested
- //require in the page*.js files.
- {
- //module names are relative to baseUrl/paths config
- name: "../page1",
- include: ["app/main1"],
- exclude: ["../common"]
- },
-
- {
- //module names are relative to baseUrl
- name: "../page2",
- include: ["app/main2"],
- exclude: ["../common"]
- }
- ]
- }
- }
- },
-
- jshint: {
- options: {
- curly: true,
- eqeqeq: true,
- immed: true,
- latedef: true,
- newcap: true,
- noarg: true,
- sub: true,
- undef: true,
- eqnull: true,
- browser: true,
- nomen: true
- },
- globals: {
- define: true
- }
- }
- });
-
- grunt.registerTask('default', 'lint qunit');
- grunt.registerTask('build', 'requirejs');
-};
View
17 examples/multipage/package.json
@@ -1,4 +1,19 @@
{
+ "name": "grunt-requirejs-multipage-example",
+ "version": "0.1.0",
+ "engines": {
+ "node": ">=0.6.0"
+ },
+ "scripts": {
+ "build": "grunt build",
+ "test": "grunt qunit"
+ },
+ "dependencies": {
+ "grunt": "0.4.x",
+ "grunt-requirejs": "0.3.x",
+ "grunt-contrib-jshint": "0.1.x",
+ "grunt-contrib-qunit": "0.1.x"
+ },
"amd": {},
"volo": {
"baseUrl": "www/js/lib",
@@ -6,4 +21,4 @@
"jquery": "github:jquery/jquery/1.7.2"
}
}
-}
+}
View
2  examples/multipage/www/js/app/lib.js
@@ -3,5 +3,5 @@ define(['jquery'], function ($) {
getBody: function () {
return $('body');
}
- }
+ };
});
View
5 package.json
@@ -42,7 +42,10 @@
},
"devDependencies": {
"grunt-contrib-clean": "0.3.x",
- "grunt-contrib-copy": "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"
},
"keywords": [
"gruntplugin", "requirejs"
View
2  tasks/require.js
@@ -13,7 +13,7 @@ module.exports = function (grunt) {
var Q = require('q');
var semver = require('semver');
// TODO: ditch this when grunt 0.4.0 is out
- grunt.util = grunt.util || grunt.utils;
+ var util = grunt.util = grunt.util || grunt.utils;
// Path to internal libs
var intLibPath = '../lib/';
Please sign in to comment.
Something went wrong with that request. Please try again.