Skip to content

Add examples for bundleExportKey feature to docs #28

Description

@zachleat

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 */";

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation
    No fields configured for Documentation.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions