@11ty/eleventy-plugin-webc 0.12.0-beta.2 → 0.12.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,9 +21,12 @@ module.exports = function(eleventyConfig, options = {}) {
21
21
  scopedHelpers: ["css", "js", "html"],
22
22
  useTransform: false, // global transform
23
23
  transformData: {}, // extra global data for transforms specifically
24
- bundlePluginOptions: {},
25
24
  }, options);
26
25
 
26
+ options.bundlePluginOptions = Object.assign({
27
+ hoistDuplicateBundlesFor: ["css", "js"]
28
+ }, options.bundlePluginOptions);
29
+
27
30
  if(options.components) {
28
31
  let components = options.components;
29
32
  if(!Array.isArray(components)) {
@@ -46,15 +49,19 @@ module.exports = function(eleventyConfig, options = {}) {
46
49
  }
47
50
  }
48
51
 
49
- // v0.12.0 upstream `bundlePluginOptions.toFileDirectory` (via Bundle Plugin changes) default changed from "bundle" to ""
52
+ // v0.12.0 upstream
53
+ // `bundlePluginOptions.toFileDirectory` (via Bundle Plugin changes) default changed from "bundle" to ""
50
54
  // https://github.com/11ty/eleventy-plugin-bundle/releases/tag/v2.0.0
51
- let htmlBundleOptions = Object.assign({}, options.bundlePluginOptions, {
52
- hoist: false, // don’t hoist
53
- });
54
55
 
55
- eleventyConfig.addBundle("html", htmlBundleOptions);
56
- eleventyConfig.addBundle("css", options.bundlePluginOptions);
57
- eleventyConfig.addBundle("js", options.bundlePluginOptions);
56
+ eleventyConfig.addBundle("html", Object.assign({}, options.bundlePluginOptions, {
57
+ hoist: options.bundlePluginOptions.hoistDuplicateBundlesFor.includes("html"),
58
+ }));
59
+ eleventyConfig.addBundle("css", Object.assign({}, options.bundlePluginOptions, {
60
+ hoist: options.bundlePluginOptions.hoistDuplicateBundlesFor.includes("css"),
61
+ }));
62
+ eleventyConfig.addBundle("js", Object.assign({}, options.bundlePluginOptions, {
63
+ hoist: options.bundlePluginOptions.hoistDuplicateBundlesFor.includes("js")
64
+ }));
58
65
 
59
66
  templatePlugin(eleventyConfig, options);
60
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@11ty/eleventy-plugin-webc",
3
- "version": "0.12.0-beta.2",
3
+ "version": "0.12.0-beta.3",
4
4
  "description": "WebC support for Eleventy adds for Single File Web Components",
5
5
  "main": "eleventyWebcPlugin.js",
6
6
  "scripts": {