Attributes
Includes Deno configuration
Repository
Current version released
3 years ago
Asset bundler for Deno apps
deno-buckets
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.tsRun:
buckets <entry_path> [import_map_path] > out.jsBuckets will look for deno.json or deno.jsonc in the current folder. To use a different
imports map, pass it’s path as the second argument
Alternatively, you can use it directly from the deno.land/x source:
deno run --allow-read --allow-write --allow-net --allow-env https://deno.land/x/buckets@v0.7.0/buckets.ts your_entry_file.ts > bundle.jsAPI
import { bundle } from "https://deno.land/x/buckets/mod.ts";
const content = await bundle("./app.ts", "deno.json");
Deno.writeTextFileSync("app.bundle.js", content);© 2021 Jacobo Tabernero Rey - Released under MIT License