- 2.58.0+0.20.0Latest
- 2.52.7+0.19.1
- 2.52.7+0.19.0
- 2.50.5+0.18.2
- 2.50.5+0.18.1
- 2.50.5+0.18.0
- 2.42.3+0.17.1
- 2.42.3+0.17.0
- 2.41.0+0.16.1
- 2.41.0+0.16.0
- 2.39.1+0.15.0
- 2.39.0+0.14.0
- 2.38.5+0.13.0
- 2.38.5+0.12.0
- 2.38.5+0.11.0
- 2.38.4+0.10.0
- 2.38.4+0.9.1
- 2.38.4+0.9.0
- 2.38.4+0.8.0
- 2.38.1+0.7.4
- 2.38.0+0.7.3
- 2.38.0+0.7.2
- 2.38.0+0.7.1
- 2.38.0+0.7.0
- 2.38.0+0.6.1
- 2.38.0+0.6.0
- 2.37.1+0.5.1
- 2.37.1+0.5.0
- 2.36.2+0.4.1
- 2.36.2+0.4.0
- 2.36.2+0.3.0
- 2.36.1+0.2.0
- 2.36.1+0.1.0
deno-rollup
Next-generation ES module bundler for Deno ported from Rollup.
Table of Contents
Overview
Rollup is a module bundler for JavaScript which compiles small pieces of code into something larger and more complex, such as a library or application.
This library extends Rollup so that it can be used within Deno scripts to bundle Deno code.
Installation
deno-rollup can be used either through a command line interface (CLI) with an optional configuration file, or else through its JavaScript API.
CLI
To install the CLI run:
deno install -f -q --allow-read --allow-write --allow-net --unstable https://deno.land/x/drollup@2.36.1+0.2.0/rollup.ts
And follow any suggestions to update your PATH
environment variable.
You can then use the CLI to bundle your modules:
# compile to an ESM
rollup main.js --format es --name "myBundle" --file bundle.js
JavaScript API
You can import deno-rollup straight into your project to bundle your modules:
import { rollup } from "https://deno.land/x/drollup@2.36.1+0.2.0/mod.ts";
const options = {
input: "./mod.ts",
output: {
dir: "./dist",
format: "es" as "es",
sourcemap: true,
},
};
const bundle = await rollup(options);
await bundle.write(options.output);
Documentation
Please refer to the official Rollup Documentation. Specifically, please refer to the JavaScript API which this library extends to provide Deno compatibility.
Note: currently this library only supports the
rollup
method, it does not yet have support for thewatch
method.
Example
To run the example:
Clone the deno-rollup repo locally:
git clone git://github.com/cmorten/deno-rollup.git --depth 1 cd deno-rollup
Then enter the example directory and run the build script:
cd example deno run --allow-read="./" --allow-write="./dist" --allow-net="deno.land" --unstable ./rollup.build.ts
Further details are available in the example README.
Contributing
License
deno-rollup is licensed under the MIT License.
The license for the Rollup library, which this library adapts, is available at ROLLUP_LICENSE.