{"id":13622189,"url":"https://github.com/timreichen/Bundler","last_synced_at":"2025-04-15T05:34:00.948Z","repository":{"id":37089272,"uuid":"283737583","full_name":"timreichen/Bundler","owner":"timreichen","description":"A Bundler with the web in mind.","archived":false,"fork":false,"pushed_at":"2022-09-06T23:48:22.000Z","size":1865,"stargazers_count":147,"open_issues_count":0,"forks_count":13,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-28T12:15:41.184Z","etag":null,"topics":["bundler","deno"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"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/timreichen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-30T10:11:18.000Z","updated_at":"2024-08-27T17:17:10.000Z","dependencies_parsed_at":"2022-07-12T02:49:34.879Z","dependency_job_id":null,"html_url":"https://github.com/timreichen/Bundler","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timreichen%2FBundler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timreichen%2FBundler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timreichen%2FBundler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timreichen%2FBundler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timreichen","download_url":"https://codeload.github.com/timreichen/Bundler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223661423,"owners_count":17181666,"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":["bundler","deno"],"created_at":"2024-08-01T21:01:15.417Z","updated_at":"2024-11-08T09:31:02.470Z","avatar_url":"https://github.com/timreichen.png","language":"TypeScript","funding_links":[],"categories":["deno"],"sub_categories":[],"readme":"# Bundler\n\n![Bundler](./static/icon.svg)\n\n- [About](#about)\n- [Goals](#goals)\n- [Features](#features)\n  - [Typescript and Javascript](#typescript-and-javascript)\n  - [HTML](#html)\n  - [CSS](#css)\n  - [Smart-Splitting](#smart-splitting)\n  - [Dev tools](#dev-tools)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [CLI](#cli)\n  - [API](#api)\n- [Unstable](#unstable)\n\n## About\n\nBundler is a zero configuration bundler with the web in mind.\n\n## Goals\n\n- Webplatform and Deno are the source of truth\n- Embrace the future (no legacy feature support)\n- No configuration setup\n- Allow flexible and modular usage of bundler API and CLI\n\n## Features\n\n### Typescript and Javascript\n\n- handles static `import` and `export` statements\n- handles dynamic `import()` statements\n- handles `fetch()` statements\n- handles `WebWorker` imports\n- handles `ServiceWorker` imports\n\n### HTML\n\n- handles `\u003clink\u003e`, `\u003cscript\u003e`, `\u003cstyle\u003e`, `\u003csource\u003e`, `\u003cimg\u003e` and `\u003cvideo\u003e`\n  tags\n- handles `style` attributes\n\n### CSS\n\n- handles `css` `@import` statements\n- supports [postcss-preset-env](https://preset-env.cssdb.org) **stage 2** and\n  **nesting-rules** by default\n\n### Smart-Splitting\n\nBundler automatically analyzes the dependency graph and splits dependencies into\nseparate files, if it is used on multiple occasions. This prevents code\nduplication and allows multiple bundle files to share code.\n\n### Dev tools\n\n- built in file watcher with `--watch` option\n- built in code optimization and minification with `--optimize` option\n- uses cache dir `.bundler` for faster reloads\n\n## Installation\n\n```sh\ndeno install --unstable --allow-read --allow-write --allow-net --allow-env --name bundler https://deno.land/x/bundler/cli.ts\n```\n\n**Info**: You might need to specify `--root /usr/local`.\n\n## Usage\n\n### CLI\n\n```sh\nbundler bundle index.html=index.html\n```\n\nThis will analyze the entry file `index.html` and its dependencies, generate\nbundles and write the output files into an directory.\n\n#### Options \u003c!-- omit in toc --\u003e\n\n|               Option | Description                                                                                                                                                                                                                                                                                                                                                           | Default |\n| -------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |\n| -c, --config \\\u003cFILE\u003e | The configuration file can be used to configure different aspects of\u003cbr\u003edeno including TypeScript, linting, and code formatting. Typically\u003cbr\u003ethe configuration file will be called `deno.json` or `deno.jsonc`\u003cbr\u003eand automatically detected; in that case this flag is not necessary.\u003cbr\u003eSee\u003cbr\u003ehttps://deno.land/manual@v1.22.0/getting_started/configuration_file | {}      |\n|     --out-dir \\\u003cDIR\u003e | Name of out_dir                                                                                                                                                                                                                                                                                                                                                       | \"dist\"  |\n|           -h, --help | Prints help information                                                                                                                                                                                                                                                                                                                                               |         |\n| --import-map \\\u003cFILE\u003e | Load import map file from local file or remote URL.\u003cbr\u003eDocs:\u003cbr\u003ehttps://deno.land/manual@v1.22.0/linking_to_external_code/import_maps\u003cbr\u003eSpecification: https://wicg.github.io/import-maps/\u003cbr\u003eExamples: https://github.com/WICG/import-maps#the-import-mapfile                                                                                                       | {}      |\n|           --optimize | Optimize source code                                                                                                                                                                                                                                                                                                                                                  | false   |\n|      -L, --log-level | Set log level [possible values: debug, info]                                                                                                                                                                                                                                                                                                                          | debug   |\n|          -q, --quiet | Suppress diagnostic output                                                                                                                                                                                                                                                                                                                                            | false   |\n|              --watch | Watch files and re-bundle on change                                                                                                                                                                                                                                                                                                                                   | false   |\n\n### API\n\n#### Example \u003c!-- omit in toc --\u003e\n\n```ts\nimport { bundle } from \"https://deno.land/x/bundler/mod.ts\";\n\nconst input = \"src/index.html\";\n\nconst inputs = [input];\nconst outputMap = { [input]: \"index.html\" };\n\nconst { bundles } = await bundle(inputs, { outputMap });\n```\n\n#### Advanced Example \u003c!-- omit in toc --\u003e\n\n```ts\nimport {\n  Bundler,\n  HTMLPlugin,\n  TypescriptPlugin,\n} from \"https://deno.land/x/bundler/mod.ts\";\n\nconst input = \"src/index.html\";\n\nconst inputs = [input];\nconst outputMap = { [input]: \"index.html\" };\n\nconst plugins = [\n  new HTMLPlugin(),\n  new TypescriptPlugin(),\n];\n\nconst bundler = new Bundler({ plugins });\n\nconst assets = await bundler.createAssets(inputs);\nconst chunks = await bundler.createChunks(inputs, assets, { outputMap });\nconst bundles = await bundler.createBundles(chunks);\n```\n\n## Unstable\n\nThis module requires deno to run with the `--unstable` flag. It is likely to\nchange in the future.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimreichen%2FBundler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimreichen%2FBundler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimreichen%2FBundler/lists"}