Ready to work offline!

New content is available. Click OK to refresh all open tabs.

bundle

a quick npm package size checker

Bundled in ...
...

Usage

* Check the console for error messages.

* Note: Treeshaking is available, but since esbuild and rollup doesn't have access to each packages package.json, it assumes that there are sideEffects.


You can use custom protocols to specify which CDN the module should come from.



e.g.

import { toStr } from "skypack:@okikio/animate";
// or
export * from "esm:@okikio/animate"; 
// or 
export { animate } from "https://cdn.skypack.dev/@okikio/animate";

* If an error occurs try using a different CDN, by default bundle uses cdn.skypack.dev but you can use the others.


* For some packages an error occurs where the default export is excluded from the treeshaken bundle, the solution for this is to manually include the default export like so,

export * from "solid-dismiss";
// and
export { default } from "solid-dismiss";



URL Queries & Shareable Links


You can now use search queries in bundle, all you need to do is add this to the url
?q={packages}&treeshake={methods to treeshake}

e.g.
You want react, react-dom, vue, and @okikio/animate, but only want the Animate and toStr methods exported from @okikio/animate.

You would add this to the url ?q=react,react-dom,vue,@okikio/animate&treeshake=[*],[*],[*],[Animate,toStr]

If you only want a couple packages and don't care to treeshake, then all you need is something like this,?q=react,react-dom,vue,@okikio/animate. There is another way to share a reproduciable bundle, the sharable link. Shareble links look like this /?share=PTAEGEBs... with the string value of the input code editor being compressed into a string and placed into the URL.

In order to create a shareble link, you click the Share button, it copies the share url to your clipboard, and from there you can paste where you wish.

Auto-bundling shared URL's

If you would like to bundle your code when the share URL is loaded, add bundle to the url, e.g. /?bundle&q=@okikio/animate or /?bundle&share=PTAEGEBs...



Badges

You can also add bundle badges, they look like this,


All you need to do is to add this to your README.md
# Light Mode Badge 
[![Open Bundle](https://bundle.js.org/badge-light.svg)](https://bundle.js.org/)

# Dark Mode Badge 
[![Open Bundle](https://bundle.js.org/badge-dark.svg)](https://bundle.js.org/)

You can use the URL Queries & Shareable Links above, to create unique bundles, when users clicks on the badge.




👋 00000 visits