oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
72.84k stars 2.64k forks source link

Support `bundledDependencies` in bun install #8780

Open huseeiin opened 6 months ago

huseeiin commented 6 months ago

What is the problem this feature would solve?

in this example all dependencies of this CLI are bundled by bun build

package.json:

{
    "scripts": {
        "build": "bun build src/index.ts --target bun --outdir dist"
    },
    "dependencies": {
        "@clack/prompts": "^0.7.0",
        "@faker-js/faker": "^8.4.0",
        "consola": "^3.2.3",
        "kolorist": "^1.8.0"
    },
    "bundledDependencies": [
        "@clack/prompts",
        "@faker-js/faker",
        "consola",
        "kolorist"
    ],
    "bin": {
        "create-svelte-bun": "dist/index.js"
    }
}

What is the feature you are proposing to solve the problem?

bun shouldn't download bundledDependencies again since they are already included in dist

What alternatives have you considered?

No response

Hexagon commented 2 months ago

This could be considered a bug instead of enhancement - if a bundled dependency isn't available on npm, download (and install) fails even though the dependencies in fact are available.