File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
packages/@tailwindcss-vite/src Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -218,9 +218,20 @@ class Root {
218218 // not considered a Tailwind root. When this happened, the root can be GCed.
219219 public async generate (
220220 content : string ,
221- addWatchFile : ( file : string ) => void ,
221+ _addWatchFile : ( file : string ) => void ,
222222 I : Instrumentation ,
223223 ) : Promise < string | false > {
224+ function addWatchFile ( file : string ) {
225+ // Scanning `.svg` file containing a `#` or `?` in the path will
226+ // crash Vite. We work around this for now by ignoring updates to them.
227+ //
228+ // https://github.com/tailwindlabs/tailwindcss/issues/16877
229+ if ( / [ \# \? ] .* \. s v g $ / . test ( file ) ) {
230+ return
231+ }
232+ _addWatchFile ( file )
233+ }
234+
224235 let requiresBuildPromise = this . requiresBuild ( )
225236 let inputPath = idToPath ( this . id )
226237 let inputBase = path . dirname ( path . resolve ( inputPath ) )
You can’t perform that action at this time.
0 commit comments