We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 16a73c0 commit ffab442Copy full SHA for ffab442
packages/vite/src/node/plugins/css.ts
@@ -1207,6 +1207,8 @@ export function getEmptyChunkReplacer(
1207
)
1208
}
1209
1210
+const fileURLWithWindowsDriveRE = /^file:\/\/\/[a-zA-Z]:\//
1211
+
1212
interface CSSAtImportResolvers {
1213
css: ResolveIdFn
1214
sass: ResolveIdFn
@@ -1245,7 +1247,9 @@ function createCSSResolvers(config: ResolvedConfig): CSSAtImportResolvers {
1245
1247
args[1] = fileURLToPath(args[1], {
1246
1248
windows:
1249
// file:///foo cannot be converted to path with windows mode
- isWindows && args[1].startsWith('file:///') ? false : undefined,
1250
+ isWindows && !fileURLWithWindowsDriveRE.test(args[1])
1251
+ ? false
1252
+ : undefined,
1253
})
1254
1255
return resolver(...args)
0 commit comments