@11ty/eleventy-plugin-webc 0.9.1 → 0.9.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.
@@ -22,25 +22,40 @@ module.exports = function(eleventyConfig, options = {}) {
22
22
  transformData: {}, // extra global data for transforms specifically
23
23
  }, options);
24
24
 
25
+ options.bundlePluginOptions = Object.assign({
26
+ hoistDuplicateBundlesFor: ["css", "js"]
27
+ }, options.bundlePluginOptions);
28
+
25
29
  // Deprecated: this lives in @11ty/eleventy-plugin-bundle now
26
30
  options.filters = filters;
27
31
 
28
32
  if(options.components) {
29
- eleventyConfig.addWatchTarget(options.components);
33
+ let components = options.components;
34
+ if(!Array.isArray(components)) {
35
+ components = [components];
36
+ }
37
+
38
+ for(let entry of components) {
39
+ if(entry.startsWith("npm:")) {
40
+ continue;
41
+ }
42
+
43
+ eleventyConfig.addWatchTarget(entry);
30
44
 
31
- // Opt-out of Eleventy to process components
32
- // Note that Eleventy’s default ignores already have _includes/**
45
+ // Opt-out of Eleventy to process components
46
+ // Note that Eleventy’s default ignores already have _includes/**
33
47
 
34
- // This will cause component files outside of _includes to not be watched: https://github.com/11ty/eleventy-plugin-webc/issues/29
35
- // Fixed in @11ty/eleventy@2.0.0-canary.18: https://github.com/11ty/eleventy/issues/893
36
- eleventyConfig.ignores.add(options.components);
48
+ // This will cause component files outside of _includes to not be watched: https://github.com/11ty/eleventy-plugin-webc/issues/29
49
+ // Fixed in @11ty/eleventy@2.0.0-canary.18: https://github.com/11ty/eleventy/issues/893
50
+ eleventyConfig.ignores.add(entry);
51
+ }
37
52
  }
38
53
 
39
54
  // TODO Remove this when @11ty/eleventy-plugin-bundle is moved to core.
40
55
  // If the bundle plugin has not been added, we add it here:
41
56
  let bundlePlugin = eleventyConfig.plugins.find(entry => entry.plugin.eleventyPackage === "@11ty/eleventy-plugin-bundle");
42
57
  if(!bundlePlugin) {
43
- eleventyConfig.addPlugin(eleventyBundlePlugin);
58
+ eleventyConfig.addPlugin(eleventyBundlePlugin, options.bundlePluginOptions);
44
59
  }
45
60
 
46
61
  templatePlugin(eleventyConfig, options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@11ty/eleventy-plugin-webc",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "description": "WebC support for Eleventy adds for Single File Web Components",
5
5
  "main": "eleventyWebcPlugin.js",
6
6
  "scripts": {
@@ -43,8 +43,8 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@11ty/eleventy": "^2.0.0",
46
- "@11ty/eleventy-plugin-bundle": "^1.0.1",
47
- "@11ty/webc": "^0.9.0"
46
+ "@11ty/eleventy-plugin-bundle": "^1.0.3",
47
+ "@11ty/webc": "^0.9.1"
48
48
  },
49
49
  "devDependencies": {
50
50
  "ava": "^5.2.0",
package/.editorconfig DELETED
@@ -1,15 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- indent_style = tab
5
- indent_size = 2
6
- end_of_line = lf
7
- insert_final_newline = false
8
- trim_trailing_whitespace = true
9
- charset = utf-8
10
-
11
- [*.js]
12
- insert_final_newline = true
13
-
14
- [test/*.js]
15
- trim_trailing_whitespace = false
@@ -1,20 +0,0 @@
1
- on: push
2
- jobs:
3
- build:
4
- runs-on: ${{ matrix.os }}
5
- strategy:
6
- matrix:
7
- os: ["ubuntu-latest", "macos-latest", "windows-latest"]
8
- node: ["14", "16", "18"]
9
- name: Node.js ${{ matrix.node }} on ${{ matrix.os }}
10
- steps:
11
- - uses: actions/checkout@v3
12
- - name: Setup node
13
- uses: actions/setup-node@v3
14
- with:
15
- node-version: ${{ matrix.node }}
16
- # cache: npm
17
- - run: npm install
18
- - run: npm test
19
- env:
20
- YARN_GPG: no