File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -162,15 +162,16 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
162162
163163 configureServer ( server ) {
164164 options . devServer = server
165- if ( options . compiler . invalidateTypeCache ) {
166- server . watcher . on ( 'unlink' , ( file ) => {
167- options . compiler . invalidateTypeCache ( file )
168- } )
169- }
170165 } ,
171166
172167 buildStart ( ) {
173- options . compiler = options . compiler || resolveCompiler ( options . root )
168+ const compiler = ( options . compiler =
169+ options . compiler || resolveCompiler ( options . root ) )
170+ if ( compiler . invalidateTypeCache ) {
171+ options . devServer ?. watcher . on ( 'unlink' , ( file ) => {
172+ compiler . invalidateTypeCache ( file )
173+ } )
174+ }
174175 } ,
175176
176177 async resolveId ( id ) {
You can’t perform that action at this time.
0 commit comments