Skip to content

Commit

Permalink
fix: add a warning if css urls not exist during build time (fix vitej…
Browse files Browse the repository at this point in the history
  • Loading branch information
Megrax committed Oct 3, 2022
1 parent 7c4accb commit dc7c268
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/vite/src/node/plugins/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ export function cssPlugin(config: ResolvedConfig): Plugin {
if (resolved) {
return fileToUrl(resolved, config, this)
}
if (config.command === 'build') {
// #9800 If we cannot resolve the css url, leave a warning.
config.logger.warnOnce(
`\n${url} doesn't exist at build time, it will remain unchanged to be resolved at runtime`
)
}
return url
}

Expand Down

0 comments on commit dc7c268

Please sign in to comment.