Skip to content

Commit d43460a

Browse files
committed
feat: support vue 2.7
closes #240
1 parent b2d25cd commit d43460a

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

lib/loader.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const path = require('path')
22
const loaderUtils = require('loader-utils')
3-
const compiler = require('vue-template-compiler')
43

54
const vuetifyMatcher = require('./matcher/tag')
65
const vuetifyAttrsMatcher = require('./matcher/attr')
@@ -10,6 +9,13 @@ const runtimePaths = {
109
installDirectives: require.resolve('./runtime/installDirectives')
1110
}
1211

12+
let compiler
13+
try {
14+
compiler = require('vue/compiler-sfc')
15+
} catch (e) {
16+
compiler = require('vue-template-compiler')
17+
}
18+
1319
function getMatches (type, items, matches, component) {
1420
const imports = []
1521

package.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,18 @@
2222
"loader-utils": "^2.0.0"
2323
},
2424
"peerDependencies": {
25+
"gm": "^1.23.0",
26+
"pug": "^2.0.0",
27+
"sharp": "^0.21.0",
2528
"vue-template-compiler": "^2.6.10",
2629
"vuetify": "^1.3.0 || ^2.0.0",
2730
"webpack": "^4.0.0 || ^5.0.0"
2831
},
29-
"optionalPeerDependencies": {
30-
"gm": "^1.23.0",
31-
"pug": "^2.0.0",
32-
"sharp": "^0.21.0"
32+
"peerDependenciesMeta": {
33+
"gm": { "optional": true },
34+
"pug": { "optional": true },
35+
"sharp": { "optional": true },
36+
"vue-template-compiler": { "optional": true }
3337
},
3438
"devDependencies": {
3539
"gm": "^1.23.1",

0 commit comments

Comments
 (0)