Skip to content

fix(vite): exclude packages from deno cache#3374

Merged
marvinhagemeister merged 2 commits into
freshframework:mainfrom
CertainLach:push-typvlsqkqzzn
Sep 12, 2025
Merged

fix(vite): exclude packages from deno cache#3374
marvinhagemeister merged 2 commits into
freshframework:mainfrom
CertainLach:push-typvlsqkqzzn

Conversation

@CertainLach

Copy link
Copy Markdown
Contributor

When disabling node_modules directory in Deno, prefresh plugin transforms files in ~/.cache/deno/npm/registry.npmjs.org/ directory, causing an arcane error to occur: preactjs/prefresh#124

After disabling this transform my site now works on updated fresh version

I'm not sure if is the correct way to exclude this, but I don't see any longer pattern that would work here

The cache is stored in $XDG_CACHE_HOME/deno/npm/$REGISTRY_HOST, where only deno/npm part seems to be static

Comment thread packages/plugin-vite/src/mod.ts Outdated
prefresh({
include: [/\.[cm]?[tj]sx?$/],
exclude: [/node_modules/],
exclude: [/node_modules|deno\/npm/],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the pull request description, plus I'm not sure if that would work on windows with alternative (\) path separator.

As far as I can see, vite normalizes the paths, but I can't test that.

@CertainLach

Copy link
Copy Markdown
Contributor Author

Extended matched part deno/npm => /deno/npm/ to reduce risk of possible path collision

@marvinhagemeister marvinhagemeister left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

@marvinhagemeister marvinhagemeister merged commit dd41a87 into freshframework:main Sep 12, 2025
7 checks passed
@CertainLach CertainLach deleted the push-typvlsqkqzzn branch September 12, 2025 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants