{"id":13485160,"url":"https://github.com/cmorten/deno-rollup","last_synced_at":"2025-03-27T17:30:52.069Z","repository":{"id":39647623,"uuid":"328445688","full_name":"cmorten/deno-rollup","owner":"cmorten","description":"Next-generation ES module bundler ported for Deno","archived":true,"fork":false,"pushed_at":"2022-08-28T09:20:58.000Z","size":501,"stargazers_count":74,"open_issues_count":0,"forks_count":10,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-10-29T18:05:53.297Z","etag":null,"topics":["cli","deno","deno-module","deno-rollup","denoland","javascript","rollup","rollup-library","rollupjs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmorten.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS.md","security":"SECURITY.md","support":null}},"created_at":"2021-01-10T17:59:13.000Z","updated_at":"2023-09-23T21:58:54.000Z","dependencies_parsed_at":"2022-09-20T07:02:38.440Z","dependency_job_id":null,"html_url":"https://github.com/cmorten/deno-rollup","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmorten%2Fdeno-rollup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmorten%2Fdeno-rollup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmorten%2Fdeno-rollup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmorten%2Fdeno-rollup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmorten","download_url":"https://codeload.github.com/cmorten/deno-rollup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245892471,"owners_count":20689507,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","deno","deno-module","deno-rollup","denoland","javascript","rollup","rollup-library","rollupjs"],"created_at":"2024-07-31T17:01:48.351Z","updated_at":"2025-03-27T17:30:51.351Z","avatar_url":"https://github.com/cmorten.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003edeno-rollup\u003c/h1\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\nNext-generation ES module bundler for \u003ca href=\"https://deno.land/\"\u003eDeno\u003c/a\u003e ported from \u003ca href=\"https://github.com/rollup/rollup\"\u003eRollup\u003c/a\u003e.\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://github.com/cmorten/deno-rollup/tags/\"\u003e\u003cimg src=\"https://img.shields.io/github/tag/cmorten/deno-rollup\" alt=\"Current version\" /\u003e\u003c/a\u003e\n   \u003cimg src=\"https://github.com/cmorten/deno-rollup/workflows/Test/badge.svg\" alt=\"Current test status\" /\u003e\n   \u003ca href=\"https://doc.deno.land/https/deno.land/x/drollup/mod.ts\"\u003e\u003cimg src=\"https://doc.deno.land/badge.svg\" alt=\"Deno docs\" /\u003e\u003c/a\u003e\n   \u003ca href=\"http://makeapullrequest.com\"\u003e\u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" alt=\"PRs are welcome\" /\u003e\u003c/a\u003e\n   \u003ca href=\"https://github.com/cmorten/deno-rollup/issues/\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/cmorten/deno-rollup\" alt=\"deno-rollup issues\" /\u003e\u003c/a\u003e\n   \u003cimg src=\"https://img.shields.io/github/stars/cmorten/deno-rollup\" alt=\"deno-rollup stars\" /\u003e\n   \u003cimg src=\"https://img.shields.io/github/forks/cmorten/deno-rollup\" alt=\"deno-rollup forks\" /\u003e\n   \u003cimg src=\"https://img.shields.io/github/license/cmorten/deno-rollup\" alt=\"deno-rollup license\" /\u003e\n   \u003ca href=\"https://github.com/cmorten/deno-rollup/graphs/commit-activity\"\u003e\u003cimg src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\" alt=\"deno-rollup is maintained\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://deno.land/x/drollup\"\u003e\u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fdeno-visualizer.danopia.net%2Fshields%2Flatest-version%2Fx%2Fdrollup%2Fmod.ts\" alt=\"deno-rollup latest /x/ version\" /\u003e\u003c/a\u003e\n   \u003ca href=\"https://github.com/denoland/deno/blob/main/Releases.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/deno-^1.11.4-brightgreen?logo=deno\" alt=\"Minimum supported Deno version\" /\u003e\u003c/a\u003e\n   \u003ca href=\"https://deno-visualizer.danopia.net/dependencies-of/https/deno.land/x/drollup/mod.ts\"\u003e\u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fdeno-visualizer.danopia.net%2Fshields%2Fdep-count%2Fx%2Fdrollup%2Fmod.ts\" alt=\"deno-rollup dependency count\" /\u003e\u003c/a\u003e\n   \u003ca href=\"https://deno-visualizer.danopia.net/dependencies-of/https/deno.land/x/drollup/mod.ts\"\u003e\u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fdeno-visualizer.danopia.net%2Fshields%2Fupdates%2Fx%2Fdrollup%2Fmod.ts\" alt=\"deno-rollup dependency outdatedness\" /\u003e\u003c/a\u003e\n   \u003ca href=\"https://deno-visualizer.danopia.net/dependencies-of/https/deno.land/x/drollup/mod.ts\"\u003e\u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fdeno-visualizer.danopia.net%2Fshields%2Fcache-size%2Fx%2Fdrollup%2Fmod.ts\" alt=\"deno-rollup cached size\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n**Deprecation Notice**: _Deno now supports a [`--compat` flag](https://github.com/denoland/deno/issues/12295) that allows for the running of Node modules in Deno through the [Node compatibility layer](https://deno.land/std@0.129.0/node). See the [official Rollup docs on Deno usage](https://rollupjs.org/guide/en/#deno)._\n\n_From [Deno 1.25 there is also has support for using NPM specifiers](https://deno.com/blog/v1.25#experimental-npm-support):_\n\n```ts\nimport { rollup } from \"npm:rollup\";\n```\n\n```console\ndeno run --unstable --allow-env --allow-read --allow-write npm:rollup\n```\n\n_This renders the core and CLI parts of this module obsolete._\n\n_Future efforts will be spent bolstering the Node compatibility layer instead of keeping this module aligned with Rollup for Node._\n\n---\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Installation](#installation)\n- [Documentation](#documentation)\n- [Plugins](#plugins)\n- [Examples](#examples)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Overview\n\n[Rollup](https://github.com/rollup/rollup) is a module bundler for JavaScript\nwhich compiles small pieces of code into something larger and more complex, such\nas a library or application.\n\nThis library extends Rollup so that it can be used in Deno - supporting core\nDeno features out-of-the-box such as URL imports, Typescript and JSX.\n\n## Installation\n\ndeno-rollup can be used either through a\n[command line interface (CLI)](https://rollupjs.org/guide/en/#command-line-reference)\nwith an optional configuration file, or else through its\n[JavaScript API](https://rollupjs.org/guide/en/#javascript-api).\n\n### CLI\n\nTo install the CLI run:\n\n```console\ndeno install -f -q --allow-read --allow-write --allow-net --allow-env --unstable https://deno.land/x/drollup@2.58.0+0.20.0/rollup.ts\n```\n\nAnd follow any suggestions to update your `PATH` environment variable.\n\nYou can then use the CLI to bundle your modules:\n\n```console\n# compile to an ESM\nrollup main.js --format es --name \"myBundle\" --file bundle.js\n```\n\nYou can also rebuild the bundle when it's source or config files change on disk\nusing the `--watch` flag:\n\n```console\n# recompile based on `rollup.config.ts` when source files change\nrollup -c --watch\n```\n\n### JavaScript API\n\nYou can import deno-rollup straight into your project to bundle your modules:\n\n```ts\nimport { rollup } from \"https://deno.land/x/drollup@2.58.0+0.20.0/mod.ts\";\n\nconst options = {\n  input: \"./mod.ts\",\n  output: {\n    dir: \"./dist\",\n    format: \"es\" as const,\n    sourcemap: true,\n  },\n};\n\nconst bundle = await rollup(options);\nawait bundle.write(options.output);\nawait bundle.close();\n```\n\nOr using the `watch` API:\n\n```ts\nimport { watch } from \"https://deno.land/x/drollup@2.58.0+0.20.0/mod.ts\";\n\nconst options = {\n  input: \"./src/mod.ts\",\n  output: {\n    dir: \"./dist\",\n    format: \"es\" as const,\n    sourcemap: true,\n  },\n  watch: {\n    include: [\"src/**\"],\n  },\n};\n\nconst watcher = await watch(options);\n\nwatcher.on(\"event\", (event) =\u003e {\n  // event.code can be one of:\n  //   START        — the watcher is (re)starting\n  //   BUNDLE_START — building an individual bundle\n  //                  * event.input will be the input options object if present\n  //                  * event.outputFiles contains an array of the \"file\" or\n  //                    \"dir\" option values of the generated outputs\n  //   BUNDLE_END   — finished building a bundle\n  //                  * event.input will be the input options object if present\n  //                  * event.outputFiles contains an array of the \"file\" or\n  //                    \"dir\" option values of the generated outputs\n  //                  * event.duration is the build duration in milliseconds\n  //                  * event.result contains the bundle object that can be\n  //                    used to generate additional outputs by calling\n  //                    bundle.generate or bundle.write. This is especially\n  //                    important when the watch.skipWrite option is used.\n  //                  You should call \"event.result.close()\" once you are done\n  //                  generating outputs, or if you do not generate outputs.\n  //                  This will allow plugins to clean up resources via the\n  //                  \"closeBundle\" hook.\n  //   END          — finished building all bundles\n  //   ERROR        — encountered an error while bundling\n  //                  * event.error contains the error that was thrown\n});\n\n// This will make sure that bundles are properly closed after each run\nwatcher.on(\"event\", (event) =\u003e {\n  if (event.code === \"BUNDLE_END\") {\n    event.result.close();\n  }\n});\n\n// stop watching\nwatcher.close();\n```\n\n## Documentation\n\nPlease refer to the official [Rollup Documentation](https://rollupjs.org).\n\nKnown deviations from Rollup:\n\n- Deno code support: TypeScript and URL imports supported out-of-the-box.\n- CLI does not currently support some nested \"dot\" flags, namely:\n  `--no-treeshake.*`, `--watch.*` and `--no-watch.*`.\n- CLI does not currently support the `--plugin` flag.\n- Some warnings have yet to be implemented.\n\nWhere further deviations / incompatibility are found, please raise an issue.\n\n## Plugins\n\nA suite of deno-rollup compatible plugins are available in the\n[plugins](./plugins) directory.\n\n## Examples\n\nTo run the [examples](./examples) you have a couple of options:\n\n### Direct from repository\n\n1. Run the deno-rollup `helloDeno` example directly from the repository:\n\n   ```console\n   deno run --allow-read=\"./\" --allow-write=\"./dist\" --allow-net=\"deno.land\" --allow-env --unstable https://deno.land/x/drollup@2.58.0+0.20.0/examples/helloDeno/rollup.build.ts\n   ```\n\n   This will create a `./dist` directory with the bundled files in your current\n   working directory.\n\n### Clone\n\n1. Clone the deno-rollup repo locally:\n\n   ```bash\n   git clone git://github.com/cmorten/deno-rollup.git --depth 1\n   cd deno-rollup\n   ```\n\n2. Then enter the desired examples directory and run the build script:\n\n   ```bash\n   cd examples/helloDeno\n   deno run --allow-read=\"./\" --allow-write=\"./dist\" --allow-net=\"deno.land\" --allow-env --unstable ./rollup.build.ts\n   ```\n\n   This will create a `./dist` directory with the bundled files in the current\n   directory.\n\n3. Further details are available in each example directory.\n\n## Contributing\n\n[Contributing guide](https://github.com/cmorten/deno-rollup/blob/main/.github/CONTRIBUTING.md)\n\n---\n\n## License\n\ndeno-rollup is licensed under the [MIT License](./LICENSE.md).\n\nThe license for the Rollup library, which this library adapts, is available at\n[ROLLUP_LICENSE](./ROLLUP_LICENSE.md).\n\nDerived works other than from [Rollup](https://github.com/rollup/rollup) are\nattributed with their license in source.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmorten%2Fdeno-rollup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmorten%2Fdeno-rollup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmorten%2Fdeno-rollup/lists"}