Skip to content

Comments

jsdelivr esm support#7

Merged
donseba merged 1 commit intomainfrom
jsdelivr-support-esm
Jun 17, 2025
Merged

jsdelivr esm support#7
donseba merged 1 commit intomainfrom
jsdelivr-support-esm

Conversation

@donseba
Copy link
Owner

@donseba donseba commented Jun 17, 2025

This pull request introduces support for ESM (ECMAScript Module) imports via the jsdelivr provider, enhancing the flexibility of package file handling. The changes include updates to the README.md to document the new functionality, modifications to the Client struct to support ESM mode, and adjustments to the file-fetching logic to accommodate ESM-specific behavior.

Documentation Updates:

  • README.md: Added an example demonstrating how to use the jsdelivr provider with ESM imports, including configuration for specific packages and files.

ESM Support in jsdelivr Client:

File Fetching Enhancements:

  • client/jsdelivr/jsdelivr.go: Updated the FetchPackageFiles method to include logic for handling ESM imports. When ESM mode is enabled, JavaScript files are replaced with an ESM bundle, while non-JS files (e.g., CSS) are preserved.

@donseba donseba merged commit 714cd5d into main Jun 17, 2025
1 check passed
@donseba donseba deleted the jsdelivr-support-esm branch June 17, 2025 20:13
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.

1 participant