Closed r14n closed 6 years ago
router
must be specified at the same level of src
/dest
and in each of the tasks itself. The following should work:
// As its own function
function zipRouter(filepath) {
var excluded = ['Gruntfile.js', '.DS_Store', '.git', 'package.json', 'package-lock.json', 'node_modules', 'firefox'];
for (var i = 0; i < excluded.length; i++) {
if (filepath.indexOf(excluded[i]) > -1) {
console.log('Excluded: ' + filepath);
return null;
}
}
return filepath;
}
// Inside `grunt.initConfig()`
zip: {
zipChrome: {
src: ['**'],
dest: '../emoji-input-old-versions/' + manifestVersionNumber + '-chrome.zip',
router: zipRouter
},
zipFirefox: {
src: ['**'],
dest: '../emoji-input-old-versions/' + manifestVersionNumber + '-firefox.zip',
router: zipRouter
}
}
thank you!
I have a custom router to exclude files, but I can't seem to get it to work properly with multiple zip tasks:
the two zips generated are identical (apart from filename)
it works fine when there is just one task