File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 17
17
},
18
18
"dependencies" : {
19
19
"@volar/code-gen" : " 0.34.2" ,
20
- "@volar/pug-language-service" : " 0.34.2" ,
21
20
"@volar/source-map" : " 0.34.2" ,
22
21
"@volar/vue-code-gen" : " 0.34.2" ,
23
22
"@vue/compiler-sfc" : " ^3.2.31" ,
24
23
"@vue/reactivity" : " ^3.2.31"
25
24
},
25
+ "optionalDependencies" : {
26
+ "@volar/pug-language-service" : " 0.34.2"
27
+ },
26
28
"browser" : {
27
29
"./out/plugins/pug.js" : " ./out/plugins/empty.js"
28
30
}
Original file line number Diff line number Diff line change 1
- import * as pug from '@volar/pug-language-service' ;
2
1
import { VueLanguagePlugin } from '../typescriptRuntime' ;
3
2
4
3
export default function ( ) : VueLanguagePlugin {
@@ -9,7 +8,13 @@ export default function (): VueLanguagePlugin {
9
8
10
9
if ( lang === 'pug' ) {
11
10
12
- const pugDoc = pug . baseParse ( template ) ;
11
+ let pug : typeof import ( '@volar/pug-language-service' ) | undefined ;
12
+
13
+ try {
14
+ pug = require ( '@volar/pug-language-service' ) ;
15
+ } catch { }
16
+
17
+ const pugDoc = pug ?. baseParse ( template ) ;
13
18
14
19
if ( pugDoc ) {
15
20
return {
You can’t perform that action at this time.
0 commit comments