Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/vite/src/node/plugins/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {

const toRelative = (filename: string) => {
// relative base + extracted CSS
const relativePath = path.posix.relative(cssAssetDirname!, filename)
const relativePath = path.relative(cssAssetDirname!, filename)
return relativePath[0] === '.' ? relativePath : './' + relativePath
}

Expand All @@ -615,7 +615,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
})
// resolve public URL from CSS paths
if (encodedPublicUrls) {
const relativePathToPublicFromCSS = path.posix.relative(
const relativePathToPublicFromCSS = path.relative(
cssAssetDirname!,
'',
)
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/plugins/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
async transform(html, id) {
if (id.endsWith('.html')) {
id = normalizePath(id)
const relativeUrlPath = path.posix.relative(config.root, id)
const relativeUrlPath = path.relative(config.root, id)
const publicPath = `/${relativeUrlPath}`
const publicBase = getBaseInHTML(relativeUrlPath, config)

Expand Down Expand Up @@ -776,7 +776,7 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
}

for (const [normalizedId, html] of processedHtml) {
const relativeUrlPath = path.posix.relative(config.root, normalizedId)
const relativeUrlPath = path.relative(config.root, normalizedId)
const assetsBase = getBaseInHTML(relativeUrlPath, config)
const toOutputFilePath = (
filename: string,
Expand Down