Substituted grunt-zip for grunt-contrib-compress#901
Open
Substituted grunt-zip for grunt-contrib-compress#901
Conversation
There was a problem hiding this comment.
Pull Request Overview
The PR replaces the grunt-zip plugin with grunt-contrib-compress to fix corrupt bundle artifacts and improve cross-platform compatibility.
- Swaps out
grunt-zipforgrunt-contrib-compressin devDependencies - Renames and reconfigures the Grunt “zip” task to “compress” with updated options and file patterns
- Updates task loading and default task sequence to use the new “compress” plugin
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| package.json | Removed grunt-zip and added grunt-contrib-compress dependency |
| Gruntfile.js | Renamed zip task to compress, added options.archive, mode, level, and files blocks; updated task loading and default sequence |
Comments suppressed due to low confidence (1)
Gruntfile.js:137
- [nitpick] The indentation for this
cwdproperty is misaligned compared to other entries; aligning it with the surrounding properties will improve readability.
cwd: 'build/dist',
| files: [ | ||
| { | ||
| expand: true, | ||
| src: ['images/**'] |
There was a problem hiding this comment.
[nitpick] For consistency with the dist task and to ensure a predictable folder structure inside the archive, consider adding cwd: 'images' and changing src to ['**'] under the images files block.
Suggested change
| src: ['images/**'] | |
| cwd: 'images', | |
| src: ['**'] |
| options: { | ||
| archive: 'build/dist/images.zip', | ||
| mode: 'zip', | ||
| level: 9 |
There was a problem hiding this comment.
[nitpick] Using the maximum compression level (9) can slow down build times; consider using a lower level or the default setting if ultra-high compression isn’t required.
Suggested change
| level: 9 | |
| level: 6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
Substituted development dependency
grunt-zipforgrunt-contrib-compress.The latter is more actively maintained, has more robust binary data handling and better cross-platform compatibility.
https://github.com/twolfson/grunt-zip
https://github.com/gruntjs/grunt-contrib-compress
Note that
grunt-contrib-compressuses a different library for compressing (archiver) compared togrunt-zip, which usesjszip, which in its turn is also used as one of the few external dependencies within the engine itself. A review ofjszip's functionality within Web WorldWind is in order to consider its substitution.Why Should This Be In Core?
At some point,
grunt-zipbegan producing a corrupt bundle release artifact. See #900Benefits
Artifact .zip bundling now works OK.
Potential Drawbacks
None found.
Applicable Issues
Fixes #900