Skip to content

Commit 3cdae44

Browse files
committed
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.
1 parent b292e05 commit 3cdae44

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

Gruntfile.js

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,6 @@ grunt.initConfig({
150150
},
151151
compare_size: compareFiles,
152152
concat: {
153-
ui: {
154-
options: {
155-
banner: createBanner( uiFiles ),
156-
stripBanners: {
157-
block: true
158-
}
159-
},
160-
src: uiFiles,
161-
dest: "dist/jquery-ui.js"
162-
},
163153
i18n: {
164154
options: {
165155
banner: createBanner( allI18nFiles )
@@ -178,6 +168,27 @@ grunt.initConfig({
178168
dest: "dist/jquery-ui.css"
179169
}
180170
},
171+
requirejs: {
172+
js: {
173+
options: {
174+
baseUrl: "./",
175+
paths: {
176+
jquery: "./external/jquery/jquery",
177+
external: "./external/"
178+
},
179+
preserveLicenseComments: false,
180+
optimize: "none",
181+
findNestedDependencies: true,
182+
skipModuleInsertion: true,
183+
exclude: [ "jquery" ],
184+
include: expandFiles( [ "ui/**/*.js", "!ui/i18n/*" ] ),
185+
out: "dist/jquery-ui.js",
186+
wrap: {
187+
start: createBanner( uiFiles ),
188+
}
189+
}
190+
}
191+
},
181192

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

458-
grunt.registerTask( "default", [ "lint", "test" ]);
469+
grunt.registerTask( "default", [ "lint", "requirejs", "test" ]);
459470
grunt.registerTask( "lint", [ "asciilint", "jshint", "jscs", "csslint", "htmllint" ]);
460471
grunt.registerTask( "test", [ "qunit" ]);
461-
grunt.registerTask( "sizer", [ "concat:ui", "uglify:main", "compare_size:all" ]);
462-
grunt.registerTask( "sizer_all", [ "concat:ui", "uglify", "compare_size" ]);
472+
grunt.registerTask( "sizer", [ "requirejs:js", "uglify:main", "compare_size:all" ]);
473+
grunt.registerTask( "sizer_all", [ "requirejs:js", "uglify", "compare_size" ]);
463474

464475
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"grunt-contrib-csslint": "0.2.0",
6565
"grunt-contrib-jshint": "0.7.1",
6666
"grunt-contrib-qunit": "0.6.0",
67+
"grunt-contrib-requirejs": "0.4.4",
6768
"grunt-contrib-uglify": "0.1.1",
6869
"grunt-esformatter": "0.2.0",
6970
"grunt-git-authors": "2.0.0",

0 commit comments

Comments
 (0)