Skip to content

Commit

Permalink
fix: cssAssetDirname
Browse files Browse the repository at this point in the history
  • Loading branch information
poyoho committed Aug 16, 2022
1 parent b6083fb commit 2fd5069
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/vite/src/node/plugins/css.ts
Expand Up @@ -467,9 +467,11 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
relativeFromPage: boolean = false
): string => {
const relative = config.base === './' || config.base === ''
const cssAssetDirname = relative
? getCssAssetDirname(cssAssetName)
: undefined
const encodedPublicUrls = encodePublicUrlsInCSS(config)
const cssAssetDirname =
encodedPublicUrls || relative
? getCssAssetDirname(cssAssetName)
: undefined

const toRelative = (filename: string) => {
// relative base + extracted CSS
Expand Down

0 comments on commit 2fd5069

Please sign in to comment.