Skip to content

Commit 953c49f

Browse files
committed
Build/grunt: Extend concat and min tasks to include all the files the current build includes. Headers aren't correct yet.
1 parent 98fc87a commit 953c49f

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

grunt.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ var allFiles = coreFiles.map(function(file) {
88
var rawList = allFiles.map(function(file) {
99
return file.substring(3);
1010
});
11+
12+
var minify = {
13+
'dist/ui/minified/jquery-ui.min.js': ['<banner>', 'dist/ui/jquery-ui.js'],
14+
// TODO adjust banner to get access to the list of included files
15+
'dist/ui/minified/i18n/jquery-ui-i18n.min.js': ['<banner>', 'dist/ui/i18n/jquery-ui-i18n.js']
16+
};
17+
function minFile(file) {
18+
// TODO adjust banner to get access to the list of included files
19+
minify['dist/' + file.replace(/\.js$/, '.min.js').replace(/ui\//, 'ui/minified/')] = ['<banner>', file];
20+
}
21+
allFiles.forEach(minFile);
22+
file.expand('ui/i18n/*.js').forEach(minFile);
23+
1124
config.init({
1225
pkg: '<json:package.json>',
1326
meta: {
@@ -20,11 +33,10 @@ config.init({
2033
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
2134
},
2235
concat: {
23-
'dist/jquery-ui.js': allFiles
24-
},
25-
min: {
26-
'dist/jquery-ui.min.js': ['<banner>', 'dist/jquery-ui.js']
36+
'dist/ui/jquery-ui.js': allFiles,
37+
'dist/ui/i18n/jquery-ui-i18n.js': 'ui/i18n/*.js'
2738
},
39+
min: minify,
2840
zip: {
2941
dist: {
3042
src: [
@@ -80,11 +92,12 @@ task.registerBasicTask('zip', 'Create a zip file for release', function(data) {
8092
var zip = new AdmZip();
8193
files.forEach(function(file) {
8294
log.verbose.writeln('Zipping ' + file);
83-
zip.addFile(file, fs.readFileSync(file));
95+
// rewrite file names from dist folder (created by build), drop the /dist part
96+
zip.addFile(file.replace(/^dist/, ''), fs.readFileSync(file));
8497
});
8598
zip.writeZip(data.dest);
8699
log.writeln("Wrote " + files.length + " files to " + data.dest);
87100
});
88101

89102
task.registerTask('default', 'lint qunit');
90-
task.registerTask('release', 'default concat min zip');
103+
task.registerTask('release', 'concat min zip');

0 commit comments

Comments
 (0)