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 {
162
162
163
163
configureServer ( server ) {
164
164
options . devServer = server
165
- if ( options . compiler . invalidateTypeCache ) {
166
- server . watcher . on ( 'unlink' , ( file ) => {
167
- options . compiler . invalidateTypeCache ( file )
168
- } )
169
- }
170
165
} ,
171
166
172
167
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
+ }
174
175
} ,
175
176
176
177
async resolveId ( id ) {
You can’t perform that action at this time.
0 commit comments