Skip to content

Commit 9f268da

Browse files
Megraxsapphi-red
andauthoredOct 24, 2022
fix: add a warning if css urls not exist during build time (fix #9800) (#10331)
Co-authored-by: 翠 / green <green@sapphi.red>
1 parent cffe5c9 commit 9f268da

File tree

1 file changed

+6
-0
lines changed
  • packages/vite/src/node/plugins

1 file changed

+6
-0
lines changed
 

‎packages/vite/src/node/plugins/css.ts

+6
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ export function cssPlugin(config: ResolvedConfig): Plugin {
219219
if (resolved) {
220220
return fileToUrl(resolved, config, this)
221221
}
222+
if (config.command === 'build') {
223+
// #9800 If we cannot resolve the css url, leave a warning.
224+
config.logger.warnOnce(
225+
`\n${url} referenced in ${id} didn't resolve at build time, it will remain unchanged to be resolved at runtime`
226+
)
227+
}
222228
return url
223229
}
224230

0 commit comments

Comments
 (0)
Please sign in to comment.