{"id":21285,"library":"esbuild-plugin-vue3","title":"esbuild-plugin-vue3","description":"esbuild plugin for Vue.js 3 Single File Components, mimicking Vue CLI behavior. Version 0.5.1 supports .vue file resolution with <template> (HTML/Pug), <script> (JS/TS, including <script setup> as experimental), and <style> (CSS/SCSS/SASS). It resolves path aliases from tsconfig.json and can emit HTML files with injected CSS/JS. Peer dependencies include vue@^3.4.15, cheerio, html-minifier, pug, and sass. Compared to alternatives like @snowpack/plugin-vue or vite's built-in plugin, this targets esbuild-only builds.","status":"active","version":"0.5.1","language":"javascript","source_language":"en","source_url":"https://github.com/pipe01/esbuild-plugin-vue3","tags":["javascript","esbuild","plugin","vue","vue3","sfc","typescript"],"install":[{"cmd":"npm install esbuild-plugin-vue3","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-vue3","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-vue3","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"required for parsing template and generating HTML","package":"cheerio","optional":true},{"reason":"required for minifying HTML output","package":"html-minifier","optional":true},{"reason":"required for Pug template support","package":"pug","optional":true},{"reason":"required for SCSS/SASS style support","package":"sass","optional":true},{"reason":"required for Vue 3 runtime","package":"vue","optional":false}],"imports":[{"note":"The package is CJS; default export is obtained via require('esbuild-plugin-vue3').","wrong":"const vuePlugin = require('esbuild-plugin-vue3').default","symbol":"default (plugin function)","correct":"import vuePlugin from 'esbuild-plugin-vue3'"},{"note":"CJS require yields the default export directly.","symbol":"default (plugin function) via require","correct":"const vuePlugin = require('esbuild-plugin-vue3')"},{"note":"Package does not export type definitions; use any or declare module.","symbol":"TypeScript (type imports not provided)","correct":"// No type exports; use // @ts-ignore if needed"}],"quickstart":{"code":"const esbuild = require('esbuild');\nconst vuePlugin = require('esbuild-plugin-vue3');\n\nasync function build() {\n  await esbuild.build({\n    entryPoints: ['src/app.ts'],\n    bundle: true,\n    outfile: 'dist/app.js',\n    plugins: [vuePlugin()],\n  });\n}\n\nbuild().catch(console.error);","lang":"javascript","description":"Minimal esbuild setup using esbuild-plugin-vue3 to bundle a Vue 3 SFC entry point into a single JS file."},"warnings":[{"fix":"Consider using more mature alternatives like @vitejs/plugin-vue or vue-loader for production.","message":"Plugin is not thoroughly tested; use at your own risk.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"If upgrading from 0.4.x, update the generateHTML option format.","message":"Version 0.5.1 changed the way HTML generation works: options.generateHTML now accepts a string or an object.","severity":"breaking","affected_versions":">=0.5.0"},{"fix":"Ensure tsconfig.json is present or explicitly set the alias option.","message":"Path aliases from tsconfig.json are resolved automatically, but only if a tsconfig.json exists in the working directory.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Test thoroughly; consider using <script> with setup() function as fallback.","message":"script setup support is still experimental and may have bugs or missing features.","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install required peer dependencies: npm i cheerio html-minifier","cause":"Missing optional peer dependency cheerio when using HTML generation.","error":"Error: Cannot find module 'cheerio'"},{"fix":"Use const vuePlugin = require('esbuild-plugin-vue3') instead of import.","cause":"Using ES import syntax with CJS package incorrectly.","error":"TypeError: vuePlugin is not a function"},{"fix":"Create a tsconfig.json in project root with paths, or pass alias option explicitly.","cause":"Path alias not recognized due to missing tsconfig.json or incorrect alias configuration.","error":"Error: Could not resolve './App.vue' from 'src/main.ts'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}