Skip to main content
Deno 2 is finally here 🎉️
Learn more

Asset bundler for Deno apps

deno-buckets logo
deno-buckets

deno doc GitHub License GitHub release (latest by date)

Buckets is a wrapper around the native Deno emit, it allows you to select source files, and then bundle their resolved default exports.

Example

data.ts:

// is-deno-bucket
export default Deno.readTextFileSync("./lorem.txt");

app.ts:

import data from "./data.ts";
console.log(data)

Then run: buckets app.ts > app.bundle.js:

// app.bundle.js
const __default = 'Lorem ipsum dolor sit amet\n';
console.log(__default)

Usage

Add the comment // is-deno-bucket at the beginning of the files you want to resolve before bundling. Then, bundle your app with deno-buckets. Only the default export will be resolved.

CLI

Install:

deno install --allow-net --allow-read --allow-write --allow-env https://deno.land/x/buckets/buckets.ts

Run:

buckets <entry_path> [out_file]

API

import { bundle } from "https://deno.land/x/buckets/mod.ts";

const content = await bundle("./app.ts");
Deno.writeTextFileSync("app.bundle.js", content);


© 2021 Jacobo Tabernero Rey - Released under MIT License