Halo-Lab / Halo-Lab/eleventy-packages
compression - How to ignore files
- Dominant language
- TypeScript
- Stars
- 27
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
How can I add files/paths to ignore?
Since the compression works on the output directory---not on the input-to-output cascade eleventy performs---it seems to be oblivious to paths added via `eleventyConfig.ignores.add`. For example, if I have a custom route leading to a file that doesn't exist on my local machine:
```js
...
...
```
The compression plugin detects the path and tries to compress it:
```bash
10:13:21 AM -> Icons: Start to compress "docs/_vercel/insights/script.js" file 🆙
10:13:21 AM -> Icons: Error: ENOENT: no such file or directory, open '/Users/mpiekenbrock/peekxc.github.io/docs/_vercel/speed-insights/script.js'
Error: ENOENT: no such file or directory, open '/Users/mpiekenbrock/peekxc.github.io/docs/_vercel/speed-insights/script.js'
at async open (node:internal/fs/promises:641:25)
at async Object.readFile (node:internal/fs/promises:1254:14)
at async w (/Users/mpiekenbrock/peekxc.github.io/node_modules/eleventy-plugin-compress/index.js:1:1480)
at async Promise.all (index 4)
at async Promise.all (index 0)
at async A (/Users/mpiekenbrock/peekxc.github.io/node_modules/eleventy-plugin-compress/index.js:1:2424)
at async Object. (/Users/mpiekenbrock/peekxc.github.io/node_modules/eleventy-plugin-compress/index.js:1:2947)
at async Template.runTransforms (/Users/mpiekenbrock/.nvm/versions/node/v18.1.0/lib/node_modules/@11ty/eleventy/src/Template.js:514:15)
at async Template.renderPageEntry (/Users/mpiekenbrock/.nvm/versions/node/v18.1.0/lib/node_modules/@11ty/eleventy/src/Template.js:799:15)
at async /Users/mpiekenbrock/.nvm/versions/node/v18.1.0/lib/node_modules/@11ty/eleventy/src/Template.js:822:21 💥
```
But there is no such file, so this just floods the output with errors.
Edit: seems related if not identical to #8
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the failure with an Eleventy custom route and an ignore added through eleventyConfig.ignores.add. Start from node_modules/eleventy-plugin-compress/index.js and the Eleventy Template transform frames in the trace; done means ignored or nonexistent generated paths no longer trigger compression errors, with behavior checked against the related #8 report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100