Skip to content

Conversation

@mattkhan
Copy link

@mattkhan mattkhan commented Nov 8, 2024

Problem

The latest version (4.1.0 at the time of this PR) cannot be loaded in the console via init("v4.1.0")

Solution

Before: the unkpg url would be appended with /esm/index.js regardless of the version
After: if the version starts with 4, append /index.js instead

  • same behavior for all versions that do not start with 4

Also defaults init() to use the current latest version.

Tested in Chrome locally

image

This should partially resolve #222

only partial because V3 is not supported

Alternatively, unpkg mentions:

If you omit the file path (i.e. use a “bare” URL), unpkg will serve the file specified by the unpkg field in package.json, or fall back to main.

@asselin
Copy link

asselin commented May 16, 2025

@kossnocorp The website is a great resource to understand how the functions work. Currently only 2.x is loadable in the website, and there's been a considerable number of changes between 2.x and 4.x. Could you please merge this PR to make 4.x available for use in the website?

Thank you for this awesome library, and all your work over the years on it!

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.

The init() in documentation gives broken date-fns

2 participants