Add examples for `bundleExportKey` feature to docs
bundleExportKey: "bundle" (default) 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 */";
It should be added a function for this like ``{% css {append:true,bucket:'defer'} %}` or similar, I wonder why this is implemented by default?
btw. If you work with the tailwindcss v4 you cant work with this style because you always have to resolve to your main css... so it does not work within the content.11tydata.js when we need to resolve to the main.css like @reference '../../public/css/_index.css';
Better would be a additional pairshortcode like ${bundleName}_append