Giter Club home page Giter Club logo

okikio / bundlejs Goto Github PK

View Code? Open in Web Editor NEW
711.0 8.0 12.0 503.58 MB

An online tool to quickly bundle & minify your projects, while viewing the compressed gzip/brotli bundle size, all running locally on your browser.

Home Page: https://bundlejs.com

License: MIT License

Shell 0.01% JavaScript 5.67% Pug 5.29% TypeScript 82.16% Dockerfile 0.08% SCSS 6.80%
bundle esbuild skypack typescript npm node browser esbuild-wasm monaco-editor rollup

bundlejs's Introduction

โœจ WOOOOOOH!! โœจ The bundlejs api is now out at deno.bundlejs.com and/or edge.bundlejs.com, bundle your code and get a badge.

Check out the announcement tweet

I see a badge, you see a badge, we all see badges!!!

spring-easing's badge

To create a badge just replace the domain bundlejs.com domain with deno.bundlejs.com and add /?badge, yeah, that simple

bundle - An online npm package bundle size checker | Product Hunt Open In Gitpod

A small online tool for checking the minified gzip/brotli size of npm packages.

I used monaco-editor for the code-editor, esbuild as bundler and treeshaker respectively, denoflate as a wasm port of gzip, deno_brotli as a wasm port of brotli, deno_lz4 as a wasm port of lz4, bytes to convert the compressed size to human readable values, esbuild-visualizer to visualize and analyze your esbuild bundle to see which modules are taking up space and, umami for private, publicly available analytics and general usage stats all without cookies.

This project was greatly influenced by @hardfists neo-tools and @mizchi's uniroll projects.

bundlejs is a quick and easy way to bundle your projects, minify and see it's gzip size. It's an online tool similar to bundlephobia, but bundle does all the bundling locally on you browser and can treeshake and bundle multiple packages (both commonjs and esm) together, all without having to install any npm packages and with typescript support.

The project isn't perfect, and I am still working on an autocomplete, hover intellisence, better mobile support and the high memory usage of esbuild and monaco as well as some edge case packages, e.g. monaco-editor.

If there is something I missed, a mistake, or a feature you would like added please create an issue or a pull request and I'll try to get to it. You can contribute to this project at okikio/bundle.

bundle uses Conventional Commits as the style of commit, and the Commitizen CLI to make commits easier.

You can join the discussion on github discussions.

Some of bundlejs.com's latest features were inspired by egoist/play-esbuild and hyrious/esbuild-repl, check them out they each use esbuild in different ways.

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 bundlejs.com/?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, bundlejs.com?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=PTAEGEB... 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.

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,

Open Bundle Open Bundle

All you need to do is to add this to your README.md

# Light Mode Badge 
[![Open Bundle](https://bundlejs.com/badge-light.svg)](https://bundlejs.com/)

# Dark Mode Badge 
[![Open Bundle](https://bundlejs.com/badge-dark.svg)](https://bundlejs.com/)

Another options is to use the API, e.g.

spring-easing's badge

[![spring-easing's badge](https://deno.bundlejs.com/?q=spring-easing&badge=detailed&badge-style=for-the-badge)](https://bundlejs.com/?q=spring-easing)

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

Backers & Sponsors

Backers & Sponsors are awesome people and organizations who use, enjoy, and donate to the project. The list of backers who love and support this project are,

bundlejs's People

Contributors

github-actions[bot] avatar haroenv avatar jantimon avatar notangelmario avatar okikio avatar rschristian avatar semantic-release-bot avatar valtism avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bundlejs's Issues

npms.io is flaky

Having real issues trying to get search results today. I think it would be better to switch back to registry.npmjs.com for the mean time (or permanently, was it switched for query speed?)

Failed for tippy.js

Input

import 'tippy.js/dist/tippy.css';
import 'tippy.js/animations/shift-toward.css';

export {default as tippy} from 'tippy.js';

Result

Bundling ๐Ÿš€

Fetch https://unpkg.com/[email protected]/dist/tippy.esm.js

Fetch https://unpkg.com/[email protected]/dist/tippy.css

Fetch https://unpkg.com/[email protected]/animations/shift-toward.css

Fetch https://unpkg.com/@popperjs/[email protected]/lib/index.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/modifiers/index.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/modifiers/preventOverflow.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/modifiers/applyStyles.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/modifiers/arrow.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/modifiers/computeStyles.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/modifiers/eventListeners.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/modifiers/flip.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/modifiers/hide.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/modifiers/offset.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/modifiers/popperOffsets.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/instanceOf.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/getNodeName.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/getWindow.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/utils/computeOffsets.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/utils/detectOverflow.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/utils/getBasePlacement.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/utils/getVariation.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/utils/getOppositePlacement.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/utils/getOppositeVariationPlacement.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/utils/computeAutoPlacement.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/utils/math.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/getOffsetParent.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/getDocumentElement.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/getComputedStyle.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/utils/expandToHashMap.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/getLayoutRect.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/contains.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/utils/getMainAxisFromPlacement.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/utils/within.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/utils/mergePaddingObject.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/utils/getFreshSideObject.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/utils/getAltAxis.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/getBoundingClientRect.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/utils/rectToClientRect.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/getClippingRect.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/isLayoutViewport.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/utils/userAgent.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/getParentNode.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/isTableElement.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/listScrollParents.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/getViewportRect.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/getDocumentRect.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/isScrollParent.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/getScrollParent.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/getWindowScrollBarX.js

Fetch https://unpkg.com/@popperjs/[email protected]/lib/dom-utils/getWindowScroll.js

โœ˜ [ERROR] Do not know how to load path: http-url:https://unpkg.com/@popperjs/[email protected]/lib/enums.js

โœ˜ [ERROR] Do not know how to load path: http-url:https://unpkg.com/@popperjs/[email protected]/lib/createPopper.js

โœ˜ [ERROR] Do not know how to load path: http-url:https://unpkg.com/@popperjs/[email protected]/lib/popper.js

โœ˜ [ERROR] Do not know how to load path: http-url:https://unpkg.com/@popperjs/[email protected]/lib/popper-lite.js

Size reported of bundle is off

It's reporting the following code bundles to a couple hundred bytes but it is closer to 10k or so.

export {observer,computed, dispose} from "hyperactiv";

Reports:
Bundle size is 174B -> 119B (gzip)

When I enable analisys treemap, I can see that it's able to see the code defined though.

Why does bundle have error squiggles?

Why does bundle show error squiggles for "Input", "Output" and "Console"?

Does this represent errors like in VS Code, or does it mean something else?

image

Strange behavior when using multiplug badges

Here is an example of the part of my readme where I tried to compare the sizes of packages

Package Base API Minified size Minified and gzipped size
yumi-fetch fetch
wretch fetch
ky fetch
axios XMLHttpRequest
got XMLHttpRequest

image

At first it was working fine, but now it sticks and shows the previous size. Maybe it is cache issue or something else. I've tried opening it from different devices and it work the same way

โœ˜ [ERROR] Do not know how to load path: http-url:{JS_FILE_PATH}

I get this error:

โœ˜ [ERROR] Do not know how to load path: http-url:https://unpkg.com/@builder.io/[email protected]/lib/browser/module/index-helpers/blocks-exports.js


http-url:https://unpkg.com/@builder.io/[email protected]/lib/browser/module/index.js:2:14:

      2 โ”‚ export * from "./index-helpers/blocks-exports.js";
        โ•ต               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When trying to bundle @builder.io/sdk-react-native: https://bundlejs.com/?q=%40builder.io%2Fsdk-react-native%400.8.0

I'm not sure what the issue us, the file loads just fine and obviously exists: https://unpkg.com/@builder.io/[email protected]/lib/browser/module/index-helpers/blocks-exports.js

Let me know if you need any more details!

Config externals shortcut

Is there a config shortcut to auto externals dependencies / peerDependencies?

Something like this

{
  "esbuild": {
    "external": "auto",
  }
}

Error when building react-native-code-push

image

image

[ERROR] Expected ">" but found "{"


http-url:https://unpkg.com/react-native-code-push@latest/CodePush.js:584:30:

      584 โ”‚         return <RootComponent {...props} />
          โ”‚                               ^
          โ•ต                               >

Respect default light/dark OS theme

In my system OS light/dark switch automatically based on time.

2 value switcher (line Sun/Moon button in https://bundle.js.org/) works bad in this scenario.

Can we track the OS light/dark theme (with prefers-color-scheme) and use 3-value switcher (you can move it to the footer since after supporting system theme users do not need to change theme often).

Possible badge caching issue

I'm seeing suspicious "756 B" badges for various libraries when using export *, while the bundlejs console shows different results. looks like there might be some caching problem:

Here's a screenshot in case the cache gets busted:

ะกะฝะธะผะพะบ ัะบั€ะฐะฝะฐ 2023-07-13 ะฒ 14 13 27

The actual size of fzy.js is close to 756 bytes, I suspect it might be returned for the other libraries.

Treeshaking doesn't always work

@chakra-ui/react shows the same size whether you export a few components or all of them. If you esbuild it locally however, the generated bundle is much smaller.

bundlejs: Bundle size is 920.21KB -> 297.6KB (gzip)
vs
esbuild: out.js is 397229 bytes

The package in question has both CommonJS and ESM exports. main field in package.json points at the CommonJS one. Could that be the issue?

How to use? I'm confused.

When I try to enter the following code and hit the "Build" button, I see no output.

import { initializeApp } from "@firebase/app";
import { getAnalytics } from "@firebase/analytics";
import { getAuth, onAuthStateChanged, GoogleAuthProvider, signOut } from "@firebase/auth";
import { getFirestore } from "@firebase/firestore";

Please help me.

analyze by `import` identifier

It seems to recognize the module by its export identifier.

This is a bit odd.

Also, it adds an export { xxx } to the analysis results, which is not needed for actual use, and does not indicate the exact size.

does not always work in Safari

I assume something about the bundling fails which causes fs to be undefined.

Screenshot 2021-09-13 at 10 54 42

I couldn't find a pattern to what makes this fail, it worked for the example, as well as instantsearch.js on the home page, but when I refreshed, the instantsearch.js didn't work

Build fails for `[email protected]`

With default settings enabled. Consider the following input:

export { useRemixForm, getValidatedFormData } from "remix-hook-form";

Build fails with the following error messages:

index.ts:133 โœ˜ [ERROR] Do not know how to load path: http-url:https://unpkg.com/@remix-run/[email protected]/dist/esm/routes.js

    http-url:https://unpkg.com/@remix-run/[email protected]/dist/esm/browser.js:16:80:
      16 โ”‚ ...ithHMRRevalidationOptOut, createClientRoutes } from './routes.js';
         โ•ต                                                        ~~~~~~~~~~~~~


rt @ index.ts:133
(anonymous) @ index.ts:266
error @ index.ts:265
(anonymous) @ api.es.js:1
forEach @ api.es.js:1
(anonymous) @ api.es.js:1
emit @ api.es.js:1
(anonymous) @ index.ts:90
index.ts:133 โœ˜ [ERROR] Do not know how to load path: http-url:https://unpkg.com/@remix-run/[email protected]/dist/esm/links.js

    http-url:https://unpkg.com/@remix-run/[email protected]/dist/esm/components.js:15:146:
      15 โ”‚ ...fs, getModuleLinkHrefs, getKeyedPrefetchLinks } from './links.js';
         โ•ต                                                         ~~~~~~~~~~~~


rt @ index.ts:133
(anonymous) @ index.ts:266
error @ index.ts:265
(anonymous) @ api.es.js:1
forEach @ api.es.js:1
(anonymous) @ api.es.js:1
emit @ api.es.js:1
(anonymous) @ index.ts:90
index.ts:133 โœ˜ [ERROR] Do not know how to load path: http-url:https://unpkg.com/@remix-run/[email protected]/dist/esm/scroll-restoration.js

    http-url:https://unpkg.com/@remix-run/[email protected]/dist/esm/index.js:14:34:
      14 โ”‚ export { ScrollRestoration } from './scroll-restoration.js';
         โ•ต                                   ~~~~~~~~~~~~~~~~~~~~~~~~~


rt @ index.ts:133
(anonymous) @ index.ts:266
error @ index.ts:265
(anonymous) @ api.es.js:1
forEach @ api.es.js:1
(anonymous) @ api.es.js:1
emit @ api.es.js:1
(anonymous) @ index.ts:90
index.ts:133 โœ˜ [ERROR] Do not know how to load path: http-url:https://unpkg.com/[email protected]/dist/index.js

    http-url:https://unpkg.com/[email protected]/dist/index.js:12:307:
      12 โ”‚ ...Matches, useNavigation, unstable_useBlocker } from 'react-router';
         โ•ต                                                       ~~~~~~~~~~~~~~


rt @ index.ts:133
(anonymous) @ index.ts:266
error @ index.ts:265
(anonymous) @ api.es.js:1
forEach @ api.es.js:1
(anonymous) @ api.es.js:1
emit @ api.es.js:1
(anonymous) @ index.ts:90
index.ts:133 4 error(s) (if you are having trouble solving this issue, please create a new issue in the repo, https://github.com/okikio/bundle)

Don't overwrite URL queries with sharable link when clicking 'Run'

Output Cannot Be Copied.

I can't copy the output for the following command:

export * from "@firebase/app";
export * from "@firebase/analytics";
export * from "@firebase/auth";
export * from "@firebase/firestore";
export * from "@firebase/functions";
export * from "@firebase/messaging";
export * from "@firebase/storage";
export * from "@firebase/performance";
export * from "@firebase/remote-config";
export * from "@firebase/app-check";

Just a suggestion from me, please add a feature to download the output as a text file :)

Build failed for `[email protected]`

Code editor contents

// Click Build for the Bundled, Minified & Compressed package size
export * from "[email protected]";
export { default } from "[email protected]";

URL

https://bundlejs.com/?q=recharts%402.8.0

Browser console errors

index.ts:134 โœ˜ [ERROR] Do not know how to load path: http-url:https://unpkg.com/[email protected]/class/addClass

    http-url:https://unpkg.com/[email protected]/CSSTransition:8:47:
      8 โ”‚ ...ss = _interopRequireDefault(require("dom-helpers/class/addClass"));
        โ•ต                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~


st @ index.ts:134
(anonymous) @ index.ts:267
error @ index.ts:266
(anonymous) @ api.es.js:1
forEach @ api.es.js:1
(anonymous) @ api.es.js:1
emit @ api.es.js:1
(anonymous) @ index.ts:91

โœ˜ [ERROR] Do not know how to load path: http-url:https://unpkg.com/[email protected]/class/removeClass

    http-url:https://unpkg.com/[email protected]/CSSTransition:10:50:
      10 โ”‚ ... _interopRequireDefault(require("dom-helpers/class/removeClass"));
         โ•ต                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


st @ index.ts:134
(anonymous) @ index.ts:267
error @ index.ts:266
(anonymous) @ api.es.js:1
forEach @ api.es.js:1
(anonymous) @ api.es.js:1
emit @ api.es.js:1
(anonymous) @ index.ts:91

Browser details

Chome
Version 117.0.5938.132 (Official Build) (arm64)

Screenshot of errors on webpage

Click to see screenshot

bundlejs-error-recharts

Adding modules does not work in Safari

Just found out about this project. Looks awesome, especially because Bundlephobia has been pretty flaky as of late.

In Safari, when selecting a package from the search select box, clicking add does nothing. Looks like the search results box is closing before the selection is made. No console output unfortunately.

Screen.Recording.2022-05-25.at.11.35.24.am.mov

Badges with package size

shields.io has Bundlephobia integration.

Lodash: lodash size

Would be nice to have something similar with bundlejs.

Ignore peer dependencies

There should be a way to make some imports externalized (in this case, peer dependencies). With how it is right now, it doesn't seem to be a good way to measure how well your library gets bundled.

Fetch the versions mentioned in package.json.

If I provide the complete package.json with dependencies, the code bundling process should fetch the versions mentioned in package.json instead of always fetching the latest version. Please guide me on the possible ways to achieve this.

Link -> Click here

[Bug] duplicate dependencies if two imports depend on the same package

I was using bundlejs recently to test the bundle sizes of a library I author, crossani.

I was testing the size of it with two addon packages (@crossani/spring and @crossani/flip), which both import crossani.

Bundlejs did not de-duplicate these imports of the same module, causing a bundle size larger than most real-world build tools would produce, in which one copy of the crossani package is bundled and used by both.

More generally:

  • import "a";
  • import "b";
  • a imports c
  • b imports c too
  • c included in bundle twice

App appears broken and will not finish loading

Hiya. Tried to use the site a couple weeks ago, but it appeared to break after a suggested page refresh. Came back to it today, and I'm seeing the same behavior. I tried clearing all workers/cookies/cache, etc, but I'm just seeing infinite spinners:

image

I'm getting these errors in the console:

// Error #1
SyntaxError: export declarations may only appear at top level of a module esbuild.worker.mjs:841:2489

// Error #2
Uncaught (in promise) Error: Illegal value for token color: #fff
    getId tokenization.js:113
    GF tokenization.js:91
    createFromParsedTokenTheme tokenization.js:139
    createFromRawTokenTheme tokenization.js:136
    get tokenTheme standaloneThemeServiceImpl.js:128
    _updateThemeOrColorMap standaloneThemeServiceImpl.js:288
    _updateActualTheme standaloneThemeServiceImpl.js:270
    setTheme standaloneThemeServiceImpl.js:259
    V_ standaloneCodeEditor.js:171
    x3 standaloneEditor.js:62
    KA standaloneEditor.js:49
    x3 standaloneEditor.js:61
    vZ monaco.ts:431
    Kn index.ts:324
    Kn index.ts:431
    i main.ts:99
    async* main.ts:103
    h api.es.js:2
    emit api.es.js:2
    forEach api.es.js:1
    emit api.es.js:2
    emit api.es.js:2
    method main.ts:114
    route api.es.js:2
    forEach api.es.js:1
    route api.es.js:2
    emit api.es.js:2
    forEach api.es.js:1
    emit api.es.js:2
    emit api.es.js:2
    _ready api.es.js:2
    boot api.es.js:2
    <anonymous> main.ts:118
    Kn index.ts:426
    AsyncFunctionNext self-hosted:674
    (Async: async)
    Kn index.ts:431
    i main.ts:99
    AsyncFunctionNext self-hosted:674
    (Async: async)
    <anonymous> main.ts:103
    h api.es.js:2
    emit api.es.js:2
    forEach self-hosted:1934
    forEach api.es.js:1
    emit api.es.js:2
    forEach self-hosted:206
    emit api.es.js:2
    method main.ts:114
    route api.es.js:2
    forEach self-hosted:1934
    forEach api.es.js:1
    route api.es.js:2
    emit api.es.js:2
    forEach self-hosted:1934
    forEach api.es.js:1
    emit api.es.js:2
    forEach self-hosted:206
    emit api.es.js:2
    _ready api.es.js:2
    _ready self-hosted:1161
    (Async: EventListener.handleEvent)
    boot api.es.js:2
    <anonymous> main.ts:118
    InnerModuleEvaluation self-hosted:2346
    evaluation self-hosted:2317

I'm using FF 84 on Windows, but I see the same behavior in latest Chrome as well.

Really love the tool - hopefully you can get it working again!

Failed to build node-libcurl ("Couldn't load")

When trying to build node-libcurl, I get the following error:

bundlejs_node-libcurl

The full error message is:

Error: [getRequest] Failed at request (https://unpkg.com/[email protected]/lib/binding/node_libcurl.node)
Error: Couldn't load https://unpkg.com/[email protected]/lib/binding/node_libcurl.node (404 code)
โœ˜ [ERROR] [getRequest] Failed at request (https://unpkg.com/[email protected]/lib/binding/node_libcurl.node)

Error: Couldn't load https://unpkg.com/[email protected]/lib/binding/node_libcurl.node (404 code) [plugin http-url]

http-url:https://unpkg.com/[email protected]/dist/Multi:5:25:

      5 โ”‚ const bindings = require('../lib/binding/node_libcurl.node');
        โ•ต                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(if you are having trouble solving this issue, please create a new issue in the repo, https://github.com/okikio/bundle)

Source: https://bundlejs.com/?q=node-libcurl%403.0.0&treeshake=%5B*%5D

Potentially related to #58.

Exclude `await import('[...'])` in bundle size?

Hey! Thanks for a great tool, I use it often.

I recently got a report on my library where the bundle was reported as having been increased whereas a library is dynamically imported using await import('[...]') in certain code paths (in this case only sometimes and only on the server)

My request is: would it be possible to support the stripping of dynamic imports as part of the bundle size? Or perhaps I'm missing a config option to enable this?

Examples

Should A, B, C be considered equal here? Currently, they all end up being roughly the same size whereas I'd like A and B to be treated differently.

A) Normal import

Clearly exports all of react-dom/server - should be counted in it's entirety

export * from 'react-dom/server';

https://bundlejs.com/?q=react-dom%2Fserver&treeshake=%5B*%5D&config=%7B%22analysis%22%3Atrue%7D

B) dynamic import in a function

๐Ÿ‘‹ I'd like the react-dom-import to be ignored here

export async function importReact() {
  const reactDomServer = await import('react-dom/server');
}

https://bundlejs.com/?text=%22export+async+function+importReact%28%29+%7B%5Cn++const+reactDomServer+%3D+await+import%28%27react-dom%2Fserver%27%29%3B%5Cn%7D%22&config=%7B%22analysis%22%3Atrue%7D

C) dynamic import that is actually guaranteed to be called

Unsure what's the best approach here

export async function importReact() {
  return await import('react-dom/server');
}

export const reactPromise = importReact()

https://bundlejs.com/?text=%22export+async+function+importReact%28%29+%7B%5Cn++return+await+import%28%27react-dom%2Fserver%27%29%3B%5Cn%7D%5Cn%5Cnexport+const+reactPromise+%3D+importReact%28%29%22&config=%7B%22analysis%22%3Atrue%7D

Generates an incorrect URL for a Redux Toolkit nested entry point

I'm trying to bundle this set of exports:

export { configureStore } from "@reduxjs/toolkit";
export {createApi} from "@reduxjs/toolkit/query/react";
export { Provider } from "react-redux";

It downloads React-Redux okay, but fails to download the RTK /query/react entry point, because it's generating a wrong version URL (1.0.0, when the current version is 1.9.5):

โœ˜ [ERROR] Do not know how to load path: http-url:https://unpkg.com/@reduxjs/[email protected]/dist/query/react/rtk-query-react.esm.js


/input.ts:2:24:

      2 โ”‚ export {createApi} from "@reduxjs/toolkit/query/react";
        โ•ต                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

could not build codemirror 6 correctly

just tried the tool on https://bundlejs.com/

with option set
"format": "iife",
"minify": false,

using this logic descriped here to build a codemirror 6
https://codemirror.net/examples/bundle/

import {EditorView, basicSetup} from "codemirror"
import {javascript} from "@codemirror/lang-javascript"

let editor = new EditorView({
extensions: [basicSetup, javascript()],
parent: document.body
})

when building the console brings me
Bundling ๐Ÿš€

Fetch https://unpkg.com/@codemirror/lang-javascript@latest
Fetch https://unpkg.com/codemirror@latest
Fetch https://unpkg.com/@lezer/common@%5E1.0.0
Fetch https://unpkg.com/@lezer/javascript@%5E1.0.0
Fetch https://unpkg.com/@codemirror/language@%5E6.6.0
Fetch https://unpkg.com/@codemirror/state@%5E6.0.0
Fetch https://unpkg.com/@codemirror/view@%5E6.0.0
Fetch https://unpkg.com/@codemirror/autocomplete@%5E6.0.0
Fetch https://unpkg.com/@codemirror/lint@%5E6.0.0
Fetch https://unpkg.com/@codemirror/language@%5E6.0.0
Fetch https://unpkg.com/@codemirror/commands@%5E6.0.0
Fetch https://unpkg.com/@codemirror/search@%5E6.0.0
Fetch https://unpkg.com/@lezer/highlight@%5E1.1.3
Fetch https://unpkg.com/@lezer/lr@%5E1.3.0
Fetch https://unpkg.com/@codemirror/view@%5E6.6.0
Fetch https://unpkg.com/w3c-keyname@%5E2.2.4
Fetch https://unpkg.com/@codemirror/state@%5E6.1.4
Fetch https://unpkg.com/style-mod@%5E4.0.0
Fetch https://unpkg.com/crelt@%5E1.0.5
Fetch https://unpkg.com/@codemirror/state@%5E6.2.0
Fetch https://unpkg.com/@lezer/highlight@%5E1.0.0

Done โœจ

the problem with this is, that multiple versions e.g state or view are also included and the generated codemirror js does not work...
testing the generated code brings
Uncaught Error: Unrecognized extension value in extension set ([object Object]). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.

by the way, cool project...

Build client (browser) package version

I'm trying to get the size of client side bundle, but bundlejs keeps fetching server entries instead.
Is there a way to apply the browser export condition properly? I remember this working fine a while ago.

https://bundlejs.com/?q=%40solid-primitives%2Ftransition-group&config=%7B"esbuild"%3A%7B"minify"%3Afalse%2C"conditions"%3A%5B"browser"%5D%2C"external"%3A%5B"solid-js"%5D%7D%7D

image

image

Here is how the export conditions are configured: https://github.com/solidjs-community/solid-primitives/blob/main/packages/transition-group/package.json
Haven't experienced issues with picking up the export conditions when bundling apps, but maybe I'm missing some convention?

getRequest [Failed at request]

Hey, i was trying to check what is wrong with my custom lib (size-wise), without adding webpack to scan it with webpack-bundle-analyzer. I'm using rollup.
But i'm getting get error after i press on 'Build' button.
failed-request

Not bundling - only a loading spinner

Hiya. First off, love this tool! Way better than Bundlephobia for actual meaningful results (although I do like Bundlephobia's "size over time" charts).

I last used Bundle a few days ago and it worked fine. Just tried to load it up, got a message that there was an update available, and clicked OK.

Now, it refuses to actually bundle anything, and all I get is a loading spinner:

image

Unfortunately there doesn't appear to be any error in the console, either.

Tried this with both import { createSelector } from 'reselect' and import { createStore } from 'redux'.

Hopefully that at least gives you something to go on!

Add the size of source code

It would be nice to see the size of source code in the editor, it usefull for cases when you prototype something and just want to see the impact fo the minifyer.

It is not a necessary feature, just to improve UX a little bit.

"browser" attribute in package.json is not used

The browser attribute is generally used instead of the src attribute by bundlers such as webpack.

I also tried setting the entryPoints esbuild option but that did not work either.

Very useful tool, thanks!

Option to exclude peer dependencies + package composition

@floating-ui/react-dom is ~5 kB with everything exported, but displays 52.2 kB because React+React DOM are included in the bundle.

Further, a breakdown of the package composition would be good (like webpack-bundle-analyzer) to see which dependencies are the largest of a package. That would make this more obvious

Rename "btn-share"

First off, awesome work!

It's typical for ad blockers to block elements with class btn-share (and therefore hide the "Share" button) as it is typically used for social media links.

Please consider renaming the class to btn-permalink or something that is not typically blocked.

API error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.