@vue/language-plugin-pug 3.1.4 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +8 -3
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -3,6 +3,7 @@ const source_map_1 = require("@volar/source-map");
|
|
|
3
3
|
const pug = require("volar-service-pug/lib/languageService");
|
|
4
4
|
const classRegex = /^class\s*=/;
|
|
5
5
|
const plugin = ({ modules }) => {
|
|
6
|
+
const CompilerDOM = modules['@vue/compiler-dom'];
|
|
6
7
|
return {
|
|
7
8
|
name: require('./package.json').name,
|
|
8
9
|
version: 2.2,
|
|
@@ -52,8 +53,7 @@ const plugin = ({ modules }) => {
|
|
|
52
53
|
+ ' '.repeat('</template>'.length);
|
|
53
54
|
}
|
|
54
55
|
const map = new source_map_1.SourceMap(pugFile.mappings);
|
|
55
|
-
const
|
|
56
|
-
const completed = compiler.compile(pugFile.htmlCode, {
|
|
56
|
+
const ast = CompilerDOM.parse(pugFile.htmlCode, {
|
|
57
57
|
...options,
|
|
58
58
|
comments: true,
|
|
59
59
|
onWarn(warning) {
|
|
@@ -68,7 +68,12 @@ const plugin = ({ modules }) => {
|
|
|
68
68
|
options.onError?.(createProxyObject(error));
|
|
69
69
|
},
|
|
70
70
|
});
|
|
71
|
-
|
|
71
|
+
CompilerDOM.transform(ast, options);
|
|
72
|
+
return {
|
|
73
|
+
ast: createProxyObject(ast),
|
|
74
|
+
code: '',
|
|
75
|
+
preamble: '',
|
|
76
|
+
};
|
|
72
77
|
function createProxyObject(target) {
|
|
73
78
|
const proxys = new WeakMap();
|
|
74
79
|
return new Proxy(target, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/language-plugin-pug",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@types/node": "^22.10.4",
|
|
21
21
|
"@vue/compiler-dom": "^3.5.0",
|
|
22
|
-
"@vue/language-core": "3.1.
|
|
22
|
+
"@vue/language-core": "3.1.5"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "d124a88fbf169e793c39ae4248da2092098de92d"
|
|
25
25
|
}
|