Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support rollup assets file names #413

Merged
merged 2 commits into from Dec 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/options.ts
Expand Up @@ -76,7 +76,7 @@ export async function resolveOptions(options: Partial<VitePWAOptions>, viteConfi
globDirectory: outDirRoot,
offlineGoogleAnalytics: false,
cleanupOutdatedCaches: true,
dontCacheBustURLsMatching: /\.[a-f0-9]{8}\./,
dontCacheBustURLsMatching: /[.-][a-f0-9]{8}\./,
Copy link
Contributor

@benmccann benmccann Nov 13, 2022

Choose a reason for hiding this comment

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

I think the . here (and below) needs to be escaped?

Copy link
Member Author

@userquin userquin Nov 13, 2022

Choose a reason for hiding this comment

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

IIRC, in a character class (square brackets) any character except ^, -, ] or \ is a literal, and - requires escaping only if not the first nor last one.

Copy link
Member Author

Choose a reason for hiding this comment

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

About the dot, IntelliJ showing a redundant escaping warning:

imagen

mode,
navigateFallback: 'index.html',
}
Expand All @@ -85,7 +85,7 @@ export async function resolveOptions(options: Partial<VitePWAOptions>, viteConfi
swSrc,
swDest,
globDirectory: outDirRoot,
dontCacheBustURLsMatching: /\.[a-f0-9]{8}\./,
dontCacheBustURLsMatching: /[.-][a-f0-9]{8}\./,
injectionPoint: 'self.__WB_MANIFEST',
}

Expand Down