Skip to content

Commit bbce28d

Browse files
committed
adjust regex after testing with gazebo
1 parent 1394164 commit bbce28d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/bundler-plugin-core/src/utils/__tests__/normalizePath.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ const tests: Test[] = [
132132
{
133133
name: "should handle vite legacy builds",
134134
input: {
135-
path: "test-legacy-12345678.js",
135+
path: "test-legacy.12345678.js",
136136
// in testing i've found that the format is just an empty string so we
137137
// have to brute force it in a different way
138138
format: "",
139139
metaFramework: "vite",
140140
},
141-
expected: "test-legacy-*.js",
141+
expected: "test-legacy.*.js",
142142
},
143143
];
144144

packages/bundler-plugin-core/src/utils/normalizePath.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const normalizePath = (
6868
path.includes("legacy")
6969
) {
7070
const regexReplacement =
71-
/(?<leadingDelimiter>\S+-legacy-)(?<hash>[0-9a-zA-Z\/+=_\/+=-]+)(?<endingDelimiter>.\S+)/i;
71+
/(?<leadingDelimiter>\S+-legacy\S)(?<hash>[0-9a-zA-Z\/+=_\/+=-]+)(?<endingDelimiter>.\S+)/i;
7272

7373
normalizedPath = normalizedPath.replace(
7474
regexReplacement,

0 commit comments

Comments
 (0)