Skip to content

Commit

Permalink
change the grunt config for the issue Stuk#80
Browse files Browse the repository at this point in the history
This commit updates the grunt configuration to ensure that the license
comment (starting with /*! for the minifiers) makes its way to the final
dist files.
  • Loading branch information
dduponchel committed Jan 15, 2014
1 parent 54825b7 commit 023cdbf
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
9 changes: 7 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,19 @@ module.exports = function(grunt) {
},
options: {
standalone: 'JSZip',
ignore:['./lib/nodeBuffer.js','./lib/nodeBufferReader']
ignore:['./lib/nodeBuffer.js','./lib/nodeBufferReader'],
postBundleCB: function(err, src, done) {
var license = require('fs').readFileSync('lib/license_header.js');
done(err, license + src);
}
}
}
},
uglify: {
options: {
report: 'gzip',
mangle: true
mangle: true,
preserveComments: 'some'
},
all: {
src: 'dist/jszip.js',
Expand Down
20 changes: 0 additions & 20 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
'use strict';
/*!
JSZip - A Javascript class for generating and reading zip files
<http://stuartk.com/jszip>
(c) 2009-2012 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
*/
/**
Usage:
zip = new JSZip();
zip.file("hello.txt", "Hello, World!").file("tempfile", "nothing");
zip.folder("images").file("smile.gif", base64Data, {base64: true});
zip.file("Xmas.txt", "Ho ho ho !", {date : new Date("December 25, 2007 00:00:01")});
zip.remove("tempfile");
base64zip = zip.generate();
**/

/**
* Representation a of zip file in js
* @constructor
Expand Down
19 changes: 19 additions & 0 deletions lib/license_header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*!
JSZip - A Javascript class for generating and reading zip files
<http://stuartk.com/jszip>
(c) 2009-2012 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
*/
/**
Usage:
zip = new JSZip();
zip.file("hello.txt", "Hello, World!").file("tempfile", "nothing");
zip.folder("images").file("smile.gif", base64Data, {base64: true});
zip.file("Xmas.txt", "Ho ho ho !", {date : new Date("December 25, 2007 00:00:01")});
zip.remove("tempfile");
base64zip = zip.generate();
**/

0 comments on commit 023cdbf

Please sign in to comment.