Skip to content
Permalink
Browse files

Build: Add requirejs build task

This more closely emulates what you get from the builder in terms of file order
it also will error on any dependency issues.
  • Loading branch information
arschmitz committed Jul 29, 2015
1 parent 10e2343 commit a4869031e0fc8607d99d50765a297fede409ff28
Showing with 25 additions and 13 deletions.
  1. +24 −13 Gruntfile.js
  2. +1 −0 package.json
@@ -150,16 +150,6 @@ grunt.initConfig({
},
compare_size: compareFiles,
concat: {
ui: {
options: {
banner: createBanner( uiFiles ),
stripBanners: {
block: true
}
},
src: uiFiles,
dest: "dist/jquery-ui.js"
},
i18n: {
options: {
banner: createBanner( allI18nFiles )
@@ -178,6 +168,27 @@ grunt.initConfig({
dest: "dist/jquery-ui.css"
}
},
requirejs: {
js: {
options: {
baseUrl: "./",
paths: {
jquery: "./external/jquery/jquery",
external: "./external/"
},
preserveLicenseComments: false,
optimize: "none",
findNestedDependencies: true,
skipModuleInsertion: true,
exclude: [ "jquery" ],
include: expandFiles( [ "ui/**/*.js", "!ui/i18n/*" ] ),
out: "dist/jquery-ui.js",
wrap: {
start: createBanner( uiFiles ),
}
}
}
},

// Remove the requireSpacesInsideParentheses override once everything is fixed
jscs: {
@@ -455,10 +466,10 @@ grunt.registerTask( "update-authors", function() {
});
});

grunt.registerTask( "default", [ "lint", "test" ]);
grunt.registerTask( "default", [ "lint", "requirejs", "test" ]);
grunt.registerTask( "lint", [ "asciilint", "jshint", "jscs", "csslint", "htmllint" ]);
grunt.registerTask( "test", [ "qunit" ]);
grunt.registerTask( "sizer", [ "concat:ui", "uglify:main", "compare_size:all" ]);
grunt.registerTask( "sizer_all", [ "concat:ui", "uglify", "compare_size" ]);
grunt.registerTask( "sizer", [ "requirejs:js", "uglify:main", "compare_size:all" ]);
grunt.registerTask( "sizer_all", [ "requirejs:js", "uglify", "compare_size" ]);

};
@@ -59,6 +59,7 @@
"grunt-contrib-csslint": "0.2.0",
"grunt-contrib-jshint": "0.7.1",
"grunt-contrib-qunit": "0.6.0",
"grunt-contrib-requirejs": "0.4.4",
"grunt-contrib-uglify": "0.1.1",
"grunt-esformatter": "0.2.0",
"grunt-git-authors": "2.0.0",

0 comments on commit a486903

Please sign in to comment.
You can’t perform that action at this time.