Skip to content

Library submission docs: clarify npmFilePath #1478

Description

@SableRaf

Problem

In contributing_libraries.md, the documentation for the optional npmFilePath field is a bit confusing:

(Optional) npmFilePath: A path like 'dist/library.min.js' if a specific file in the library should be used from npm. You can test this out by going to https://cdn.jsdelivr.net/npm/packageName -- if that doesn't work, try https://cdn.jsdelivr.net/npm/packageName/path/to/file.js and put the path you added into this property

When I followed these instructions while submitting a library, I wasn't sure:

  • when npmFilePath is actually needed
  • how I was supposed to discover the correct relative path

Suggested improvement

  • Explain first that most libraries do not need npmFilePath.

  • Provide simple step-by-step instructions:

    1. Check whether https://cdn.jsdelivr.net/npm/packageName loads the library. If it does, you're all set.
    2. If it doesn't, browse https://www.jsdelivr.com/package/npm/packageName to locate the JavaScript file and use its relative path as npmFilePath.

Metadata

Metadata

Assignees

Labels

DocumentationImprovements or additions to documentation

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions