@11ty/eleventy-plugin-webc 0.9.0 → 0.9.2

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.
@@ -26,14 +26,25 @@ module.exports = function(eleventyConfig, options = {}) {
26
26
  options.filters = filters;
27
27
 
28
28
  if(options.components) {
29
- eleventyConfig.addWatchTarget(options.components);
29
+ let components = options.components;
30
+ if(!Array.isArray(components)) {
31
+ components = [components];
32
+ }
30
33
 
31
- // Opt-out of Eleventy to process components
32
- // Note that Eleventy’s default ignores already have _includes/**
34
+ for(let entry of components) {
35
+ if(entry.startsWith("npm:")) {
36
+ continue;
37
+ }
33
38
 
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);
39
+ eleventyConfig.addWatchTarget(entry);
40
+
41
+ // Opt-out of Eleventy to process components
42
+ // Note that Eleventy’s default ignores already have _includes/**
43
+
44
+ // This will cause component files outside of _includes to not be watched: https://github.com/11ty/eleventy-plugin-webc/issues/29
45
+ // Fixed in @11ty/eleventy@2.0.0-canary.18: https://github.com/11ty/eleventy/issues/893
46
+ eleventyConfig.ignores.add(entry);
47
+ }
37
48
  }
38
49
 
39
50
  // TODO Remove this when @11ty/eleventy-plugin-bundle is moved to core.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@11ty/eleventy-plugin-webc",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "WebC support for Eleventy adds for Single File Web Components",
5
5
  "main": "eleventyWebcPlugin.js",
6
6
  "scripts": {
@@ -43,11 +43,11 @@
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
- "ava": "^5.1.0",
50
+ "ava": "^5.2.0",
51
51
  "node-retrieve-globals": "^2.0.4"
52
52
  }
53
53
  }
@@ -133,7 +133,7 @@ module.exports = function(eleventyConfig, options = {}) {
133
133
 
134
134
  if(buckets.css) {
135
135
  for(let bucket in buckets.css) {
136
- this.config.javascriptFunctions.css(css, buckets.css[bucket], data.page.url);
136
+ this.config.javascriptFunctions.css(buckets.css[bucket], bucket, data.page.url);
137
137
  }
138
138
  }
139
139
 
@@ -142,7 +142,7 @@ module.exports = function(eleventyConfig, options = {}) {
142
142
 
143
143
  if(buckets.js) {
144
144
  for(let bucket in buckets.js) {
145
- this.config.javascriptFunctions.js(js, buckets.js[bucket], data.page.url);
145
+ this.config.javascriptFunctions.js(buckets.js[bucket], bucket, data.page.url);
146
146
  }
147
147
  }
148
148
 
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