2 module.exports = function(grunt) {
8 browserName: "android",
12 browserName: "firefox",
15 browserName: "chrome",
18 browserName: "internet explorer",
22 browserName: "internet explorer",
26 browserName: "internet explorer",
27 platform: "Windows 7",
30 browserName: "internet explorer",
35 platform: "Windows 2008",
38 browserName: "safari",
39 platform: "OS X 10.8",
44 if (process.env.TRAVIS_PULL_REQUEST && process.env.TRAVIS_PULL_REQUEST != "false") {
45 tags.push("pr" + process.env.TRAVIS_PULL_REQUEST);
46 } else if (process.env.TRAVIS_BRANCH) {
47 tags.push(process.env.TRAVIS_BRANCH);
62 urls: ["http://127.0.0.1:9999/test/index.html"],
64 build: process.env.TRAVIS_JOB_ID,
67 testname: "qunit tests",
74 jshintrc: "./.jshintrc"
81 'dist/jszip.js': ['lib/index.js']
88 // instead of the full polyfill, we just use the raw value
90 return '(typeof Buffer !== "undefined" ? Buffer : undefined)';
94 postBundleCB: function(err, src, done) {
96 var license = require('fs').readFileSync('lib/license_header.js');
97 // remove the source mapping of zlib.js, see #75
98 var srcWithoutSourceMapping = src.replace(/\/\/@ sourceMappingURL=raw..flate.min.js.map/g, '');
99 done(err, license + srcWithoutSourceMapping);
108 preserveComments: 'some'
111 src: 'dist/jszip.js',
112 dest: 'dist/jszip.min.js'
117 grunt.loadNpmTasks("grunt-saucelabs");
118 grunt.loadNpmTasks("grunt-contrib-connect");
119 grunt.loadNpmTasks('grunt-browserify');
120 grunt.loadNpmTasks('grunt-contrib-jshint');
121 grunt.loadNpmTasks('grunt-contrib-uglify');
123 if (process.env.SAUCE_USERNAME && process.env.SAUCE_ACCESS_KEY) {
124 grunt.registerTask("test", ["connect", "saucelabs-qunit"]);
126 grunt.registerTask("test", []);
128 grunt.registerTask("build", ["browserify", "uglify"]);
129 grunt.registerTask("default", ["jshint", "build"]);