skyra-project / discord-components

Discord Webcomponents for real looking messages on the web
MIT License
243 stars 33 forks source link

request: building a single file version #172

Closed YoannMa closed 2 years ago

YoannMa commented 2 years ago

Is your feature request related to a problem? Please describe.

I'm building a screenshot feature on my Bot, using this package, building the webpage with Pug and rendering with Puppeteer, sadly I cannot import the package directly into the Puppeteer webpage, I can only make it work with the unpkg URL.

I can use the addScriptTag feature of Puppeteer, but relative import in the script won't work https://devdocs.io/puppeteer/index#pageaddscripttagoptions

Using unpkg is fine, but I rather not depend on them, especially when I can have the package locally, avoiding the extra 1-5 requests

Describe the solution you'd like

I was wondering if you could build a single file version of the package (minified or not) ?

Describe alternatives you've considered

Additional context

Using @skyra/discord-components-core package

favna commented 2 years ago

Sorry but no can do. It's not something StencilJS supports: https://stenciljs.com/docs/distribution

An alternative solution to using unpkg and when using Sapphire framework is using our @sapphire/plugin-api and providing the proper JS file that way.

YoannMa commented 2 years ago

Alright, make sense, thanks for the idea of exposing the pacakge through a webserver