11ty / 11ty/eleventy-plugin-bundle

Add examples for `bundleExportKey` feature to docs

Open
#28 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
JavaScript
Stars
83
Forks
8
PR merge metrics
No merged PRs in 30d

Description

bundleExportKey: "bundle" (this is the default value) means that you can do this in your 11ty.js template:

export const bundle = {
	css: "/* Only adds to css bundle */"
};

export function render() {};
export function data() {};

This works with buckets too, if you nest another object in your export:

export const bundle = {
  css: {
    default: "/* Only adds to default bucket in css bundle */"
  }
};

This works too but probably isn’t what you want:

export const bundle = "/* Adds to all bundles using bundleExportKey: "bundle" */";

This makes more sense, if you want to opt-in to something a bit simpler with a string export direct to a bundle:

bundleExportKey: "css" means that you can do this in your 11ty.js template:

export const css = "/* Some CSS */";

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the documentation entry for bundleExportKey and review the 11ty.js examples described in the issue. Add examples for the default bundle key, nested buckets, direct string exports, and a custom css key; done means the supported configurations and their effects are clear in the docs.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.