Skip to content

Commit 20913b0

Browse files
committed
replace _ in the CSS hash
Just happened to run into this in the release branch... ```diff - --- ./dist/assets/index-<hash>.css --- + --- ./dist/assets/index-B_aD48aL.css --- .do-include-me { color: green; } ``` For context, when we deal with Vite related integration tests, we build a CSS file, and dump all the generated files (file path + contents). Since Vite uses a hash in the filename, we stripped it and replaced it with `<hash>` because the hash doesn't matter for the tests. We just happen to run into a situation where a `_` character was used and our regex didn't match. Long story short, this is a small internal change that doesn't need any kind of changelog entry.
1 parent c3bf4d0 commit 20913b0

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

integrations/vite/resolvers.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,9 @@ test(
571571
async ({ exec, fs, expect }) => {
572572
await exec('pnpm vite build')
573573

574-
expect((await fs.dumpFiles('./dist/**/*.css')).replace(/-([a-zA-Z0-9]*?)\.css/g, '-<hash>.css'))
575-
.toMatchInlineSnapshot(`
574+
expect(
575+
(await fs.dumpFiles('./dist/**/*.css')).replace(/-([_a-zA-Z0-9]*?)\.css/g, '-<hash>.css'),
576+
).toMatchInlineSnapshot(`
576577
"
577578
--- ./dist/assets/index-<hash>.css ---
578579
.do-include-me {
@@ -641,8 +642,9 @@ test(
641642
async ({ exec, fs, expect }) => {
642643
await exec('pnpm vite build')
643644

644-
expect((await fs.dumpFiles('./dist/**/*.css')).replace(/-([a-zA-Z0-9]*?)\.css/g, '-<hash>.css'))
645-
.toMatchInlineSnapshot(`
645+
expect(
646+
(await fs.dumpFiles('./dist/**/*.css')).replace(/-([_a-zA-Z0-9]*?)\.css/g, '-<hash>.css'),
647+
).toMatchInlineSnapshot(`
646648
"
647649
--- ./dist/assets/index-<hash>.css ---
648650
@layer base {

0 commit comments

Comments
 (0)