Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build): windows platform build output path error #17818

Merged
merged 3 commits into from
Aug 6, 2024
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)
btea marked this conversation as resolved.
Show resolved Hide resolved
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)
btea marked this conversation as resolved.
Show resolved Hide resolved
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
Loading