@vue/language-plugin-pug 3.2.8 → 3.2.9

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.
Files changed (2) hide show
  1. package/index.js +2 -4
  2. package/package.json +8 -6
package/index.js CHANGED
@@ -3,7 +3,6 @@ const source_map_1 = require("@volar/source-map");
3
3
  const baseParse_1 = require("./lib/baseParse");
4
4
  const classRegex = /^class\s*=/;
5
5
  const plugin = ({ modules }) => {
6
- const CompilerDOM = modules['@vue/compiler-dom'];
7
6
  return {
8
7
  name: require('./package.json').name,
9
8
  version: 2.2,
@@ -39,6 +38,7 @@ const plugin = ({ modules }) => {
39
38
  },
40
39
  compileSFCTemplate(lang, template, options) {
41
40
  if (lang === 'pug') {
41
+ const { compileTemplate } = modules['@vue/language-core'];
42
42
  let parsed;
43
43
  let baseOffset = 0;
44
44
  const minIndent = calculateMinIndent(template);
@@ -53,9 +53,8 @@ const plugin = ({ modules }) => {
53
53
  + ' '.repeat('</template>'.length);
54
54
  }
55
55
  const map = new source_map_1.SourceMap(parsed.mappings);
56
- let ast = CompilerDOM.parse(parsed.htmlCode, {
56
+ let ast = compileTemplate(parsed.htmlCode, {
57
57
  ...options,
58
- comments: true,
59
58
  onWarn(warning) {
60
59
  if (warning.loc) {
61
60
  warning.loc.start.offset = toPugOffset(warning.loc.start.offset);
@@ -76,7 +75,6 @@ const plugin = ({ modules }) => {
76
75
  options.onError?.(error);
77
76
  },
78
77
  });
79
- CompilerDOM.transform(ast, options);
80
78
  const visited = new Set();
81
79
  visit(ast);
82
80
  return {
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@vue/language-plugin-pug",
3
- "version": "3.2.8",
3
+ "version": "3.2.9",
4
4
  "license": "MIT",
5
5
  "files": [
6
- "**/*.js",
7
- "**/*.d.ts"
6
+ "index.d.ts",
7
+ "index.js",
8
+ "lib/**/*.d.ts",
9
+ "lib/**/*.js"
8
10
  ],
9
11
  "sideEffects": false,
10
12
  "repository": {
@@ -20,9 +22,9 @@
20
22
  "vscode-languageserver-textdocument": "^1.0.12"
21
23
  },
22
24
  "devDependencies": {
23
- "@types/node": "^22.10.4",
25
+ "@types/node": "^24.1.0",
24
26
  "@vue/compiler-dom": "^3.5.0",
25
- "@vue/language-core": "3.2.8"
27
+ "@vue/language-core": "3.2.9"
26
28
  },
27
- "gitHead": "618bd6bfb19729726787df7b52fccda72c888c95"
29
+ "gitHead": "9c1fd47ffe25e86394232dfc76453a5f76cb4fe0"
28
30
  }