Skip to content

Commit

Permalink
Build: Add requirejs build task
Browse files Browse the repository at this point in the history
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 Aug 8, 2015
1 parent 10e2343 commit a486903
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
37 changes: 24 additions & 13 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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: {
Expand Down Expand Up @@ -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" ]);

};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit a486903

Please sign in to comment.