Skip to content

Commit 0166738

Browse files
committed
chore: update
1 parent 25e3aee commit 0166738

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

packages/vite/src/node/plugins/css.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -594,9 +594,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
594594

595595
const toRelative = (filename: string) => {
596596
// relative base + extracted CSS
597-
const relativePath = normalizePath(
598-
path.relative(cssAssetDirname!, filename),
599-
)
597+
const relativePath = path.relative(cssAssetDirname!, filename)
600598
return relativePath[0] === '.' ? relativePath : './' + relativePath
601599
}
602600

@@ -617,8 +615,9 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
617615
})
618616
// resolve public URL from CSS paths
619617
if (encodedPublicUrls) {
620-
const relativePathToPublicFromCSS = normalizePath(
621-
path.relative(cssAssetDirname!, ''),
618+
const relativePathToPublicFromCSS = path.relative(
619+
cssAssetDirname!,
620+
'',
622621
)
623622
chunkCSS = chunkCSS.replace(publicAssetUrlRE, (_, hash) => {
624623
const publicUrl = publicAssetUrlMap.get(hash)!.slice(1)

packages/vite/src/node/plugins/html.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
330330
async transform(html, id) {
331331
if (id.endsWith('.html')) {
332332
id = normalizePath(id)
333-
const relativeUrlPath = normalizePath(path.relative(config.root, id))
333+
const relativeUrlPath = path.relative(config.root, id)
334334
const publicPath = `/${relativeUrlPath}`
335335
const publicBase = getBaseInHTML(relativeUrlPath, config)
336336

@@ -776,9 +776,7 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
776776
}
777777

778778
for (const [normalizedId, html] of processedHtml) {
779-
const relativeUrlPath = normalizePath(
780-
path.relative(config.root, normalizedId),
781-
)
779+
const relativeUrlPath = path.relative(config.root, normalizedId)
782780
const assetsBase = getBaseInHTML(relativeUrlPath, config)
783781
const toOutputFilePath = (
784782
filename: string,

0 commit comments

Comments
 (0)