deno-rollup

Next-generation ES module bundler for Deno ported from Rollup.

Current version Current test status Deno docs PRs are welcome deno-rollup issues deno-rollup stars deno-rollup forks deno-rollup license deno-rollup is maintained deno-rollup repository visit count


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.

Getting Started

import { rollup } from "https://deno.land/x/drollup@2.36.1+0.1.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);

Installation

This is a Deno module available to import direct from this repo and via the Deno Registry.

Before importing, download and install Deno.

You can then import deno-rollup straight into your project:

import { rollup } from "https://deno.land/x/drollup@2.36.1+0.1.0/mod.ts";

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 the watch method.

Example

To run the example:

  1. Clone the deno-rollup repo locally:

    git clone git://github.com/cmorten/deno-rollup.git --depth 1
    cd deno-rollup
  2. 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
  3. Further details are available in the example README.

Contributing

Contributing guide


License

deno-rollup is licensed under the MIT License.

The license for the Rollup library, which this library adapts, is available at ROLLUP_LICENSE.