{"name":"@vue/language-plugin-pug","version":"2.2.12","license":"MIT","_id":"@vue/language-plugin-pug@2.2.12","maintainers":[{"name":"johnsoncodehk","email":"johnsoncodehk@gmail.com"},{"name":"kazariex","email":"mimorimaboroshi@gmail.com"}],"dist":{"shasum":"a3ccf77bced9c08756760569e621767ef98c2cbb","tarball":"http://registry-npm.ywwl.com/@vue/language-plugin-pug/download/@vue/language-plugin-pug-2.2.12.tgz","fileCount":5,"integrity":"sha512-NXef1YO2ro65LbfXVLVl9hnprQ4zZhTcaS+XlF3l3Dl0W5KcDxZ0UZKQB4gU5Kgn9hJZHdhF1o20df4bldSzLA==","signatures":[{"sig":"MEYCIQDgngZEQmX+KfgWzH2KY3w5r+1/jgONOX+nyC1ayqvs9AIhAMQ85E+IktUMfT+9OzDci7GW31IYeyPNe278sA6B0yE0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7591,"size":2745,"noattachment":false,"key":"/@vue/language-plugin-pug/-/@vue/language-plugin-pug-2.2.12.tgz"},"gitHead":"0b13bf1966398ea3949b6b02d09b251ddc9a51eb","_npmUser":{"name":"johnsoncodehk","actor":{"name":"johnsoncodehk","type":"user","email":"johnsoncodehk@gmail.com"},"email":"johnsoncodehk@gmail.com"},"repository":{"url":"https://github.com/vuejs/language-tools.git","type":"git","directory":"packages/language-plugin-pug"},"_npmVersion":"lerna/3.11.0/node@v22.14.0+arm64 (darwin)","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"@volar/source-map":"2.4.15","volar-service-pug":"0.0.64"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.10.4","@vue/language-core":"2.2.12"},"_npmOperationalInternal":{"tmp":"tmp/language-plugin-pug_2.2.12_1751417837165_0.610375611462332","host":"s3://npm-registry-packages-npm-production"},"readme":"# @vue/language-plugin-pug\n\n<p>\n  <a href=\"https://www.npmjs.com/package/@vue/language-plugin-pug\"><img src=\"https://img.shields.io/npm/v/@vue/language-plugin-pug.svg?labelColor=18181B&color=1584FC\" alt=\"NPM version\"></a>\n  <a href=\"https://github.com/vuejs/language-tools/blob/master/LICENSE\"><img src=\"https://img.shields.io/github/license/vuejs/language-tools.svg?labelColor=18181B&color=1584FC\" alt=\"License\"></a>\n</p>\n\nA Pug template language plugin for Vue Language Tools, enabling the use of `<template lang=\"pug\">` in Vue SFCs.\n\n## Installation\n\n```bash\nnpm install @vue/language-plugin-pug --save-dev\n```\n\n## Configuration\n\nAdd this plugin in `tsconfig.json`:\n\n```jsonc\n{\n  \"vueCompilerOptions\": {\n    \"plugins\": [\"@vue/language-plugin-pug\"]\n  }\n}\n```\n\n## Usage\n\nAfter configuration, you can use Pug syntax in Vue components:\n\n```vue\n<template lang=\"pug\">\ndiv.container\n  h1 {{ title }}\n  p {{ description }}\n  button(@click=\"handleClick\") Click me\n</template>\n\n<script setup lang=\"ts\">\nconst title = 'Hello'\nconst description = 'World'\nconst handleClick = () => console.log('clicked')\n</script>\n```\n\n## Features\n\nThis plugin implements the `VueLanguagePlugin` interface, providing:\n\n- **`getEmbeddedCodes`** - Identifies `<template lang=\"pug\">` blocks\n- **`resolveEmbeddedCode`** - Extracts Pug content as embedded code\n- **`compileSFCTemplate`** - Compiles Pug to HTML, then parses it into an AST using `@vue/compiler-dom`\n\n## How it Works\n\n1. Uses `pug-lexer` to convert Pug syntax into tokens\n2. Uses `pug-parser` to parse tokens into an AST\n3. Traverses the AST to generate HTML while building a source map\n4. Uses `@vue/compiler-dom.parse` to parse the HTML\n5. Uses `@vue/compiler-dom.transform` to transform the AST\n6. Maps error and warning positions back to the original Pug code via the source map\n\n## Related Packages\n\n- [`@vue/language-core`](../language-core) - Core module\n\n## License\n\n[MIT](https://github.com/vuejs/language-tools/blob/master/LICENSE) License\n","publish_time":1751417837364,"_cnpm_publish_time":1751417837364,"dist-tags":{"alpha":"4.0.0-alpha.3","latest":"3.3.14","v3.0":"3.0.11"}}