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: add a warning if css urls not exist during build time (fix #9800) #10331

Merged
merged 2 commits into from Oct 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/vite/src/node/plugins/css.ts
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} referenced in ${id} didn't resolve at build time, it will remain unchanged to be resolved at runtime`
)
}
return url
}

Expand Down