@11ty/eleventy-plugin-bundle
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -21,2 +21,3 @@ const BundleFileOutput = require("./BundleFileOutput"); | ||
this.toFileDirectory = undefined; | ||
this.bundleExportKey = "bundle"; | ||
} | ||
@@ -36,2 +37,10 @@ | ||
setBundleExportKey(key) { | ||
this.bundleExportKey = key; | ||
} | ||
getBundleExportKey() { | ||
return this.bundleExportKey; | ||
} | ||
reset() { | ||
@@ -38,0 +47,0 @@ this.pages = {}; |
@@ -14,2 +14,3 @@ const pkg = require("./package.json"); | ||
hoistDuplicateBundlesFor: [], | ||
bundleExportKey: "bundle", // use a `bundle` export in a 11ty.js template to populate bundles | ||
}, options); | ||
@@ -46,2 +47,3 @@ | ||
toFileDirectory: pluginOptions.toFileDirectory, | ||
bundleExportKey: pluginOptions.bundleExportKey, // `false` will skip bundle export | ||
}); | ||
@@ -48,0 +50,0 @@ }); |
@@ -25,2 +25,6 @@ | ||
if(bundleOptions.bundleExportKey !== undefined) { | ||
managers[name].setBundleExportKey(bundleOptions.bundleExportKey); | ||
} | ||
if(bundleOptions.outputFileExtension) { | ||
@@ -27,0 +31,0 @@ managers[name].setFileExtension(bundleOptions.outputFileExtension); |
{ | ||
"name": "@11ty/eleventy-plugin-bundle", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Little bundles of code, little bundles of joy.", | ||
@@ -5,0 +5,0 @@ "main": "eleventy.bundle.js", |
@@ -44,17 +44,21 @@ # eleventy-plugin-bundle | ||
eleventyConfig.addBundle("css", { | ||
// Optional, folder (relative to output directory) files will write to: | ||
// (Optional) Folder (relative to output directory) files will write to | ||
toFileDirectory: "bundle", | ||
// Optional, defaults to bundle name | ||
// (Optional) File extension used for bundle file output, defaults to bundle name | ||
outputFileExtension: "css", | ||
// Optional, defaults to bundle name | ||
// (Optional) Name of shortcode for use in templates, defaults to bundle name | ||
shortcodeName: "css", | ||
// shortcodeName: false, // don’t add a shortcode. | ||
// shortcodeName: false, // disable this feature. | ||
// Optional, modify bundle content | ||
// (Optional) Modify bundle content | ||
transforms: [], | ||
// Optional (advanced): if two identical code blocks exist in non-default buckets, they’ll be hoisted to the first bucket in common. | ||
// (Optional) If two identical code blocks exist in non-default buckets, they’ll be hoisted to the first bucket in common. | ||
hoist: true, | ||
// (Optional) In 11ty.js templates, having a named export of `bundle` will populate your bundles. | ||
bundleExportKey: "bundle", | ||
// bundleExportKey: false, // disable this feature. | ||
}); | ||
@@ -61,0 +65,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30484
509
337