Open morganney opened 1 year ago
As a workaround I can provide documentation that suggests using another CDN, for example JSDelivr works without removing query parameters.
GET https://cdn.jsdelivr.net/npm/tts-element@0.0.2-beta/dist/text-to-speech/defined.js?name=my-tts
returns a 200 allowing my element to work as expected when loaded with a query parameter in the specifier.
I've noticed this as well. My web framework parses import.meta.url
and applies the theme based on input
jsdeliver does work:
import { Button } from 'https://cdn.jsdelivr.net/npm/@shortfuse/materialdesignweb@0.7.1-7/dist/index.min.js?color=6750A4&custom=yellow,orange:orange,green:0f0,alias:aqua&lightness=auto';
But as described, unpkg will do a 302 redirect without the URL parameters.
It seems this is intentional:
Perhaps we add a special argument that force unpkg to pass arguments? Something like url?unpkgQuery&customParams=foo
?
Is there any way to preserve query parameters other than
?module
and?meta
when requesting a package? I've noticed that adding any other query parameter will result in a 302 redirect removing the query from the url.My use case is to provide the ability to
define
an HTML custom element with a customname
upon loading. Currently my project uses aname
query parameter from the import specifier to allow clients to customize the name used for the element.Request:
GET https://unpkg.com/tts-element@0.0.2-beta/dist/text-to-speech/defined.js?name=tts-ele
Response:302 Location: /tts-element@0.0.2-beta/dist/text-to-speech/defined.js
Are arbitrary query parameters not supported, or am I just missing something? The closest I've seen in regards to this issue is #93.