Skip to content

Conversation

@donseba
Copy link
Owner

@donseba donseba commented Jun 13, 2025

This pull request enhances the functionality of the client/jsdelivr package by adding support for identifying and including minified versions of .js and .css files. It also introduces corresponding tests to ensure correctness. The changes primarily focus on extending file handling logic and updating the library utilities.

Enhancements to file handling:

  • client/jsdelivr/jsdelivr.go: Added regex patterns to identify .js and .css files and their minified counterparts (.min.js and .min.css). Updated the walkFiles function to include minified file paths for .js and .css files when they are not already present. [1] [2] [3]
  • library/files.go: Introduced the FileNameMin function to generate the minified file names for .js and .css files based on their original names.

Test coverage:

  • client/jsdelivr/jsdelivr_test.go: Added a new test, TestIncludeMinified, to verify that the FetchPackageFiles function correctly includes minified file versions for a sample package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants