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.
npm install esbuild-plugin-vue3Verified import paths — ran on the pinned version, not inferred.
Minimal esbuild setup using esbuild-plugin-vue3 to bundle a Vue 3 SFC entry point into a single JS file.
Consider using more mature alternatives like @vitejs/plugin-vue or vue-loader for production.
If upgrading from 0.4.x, update the generateHTML option format.
Ensure tsconfig.json is present or explicitly set the alias option.
Test thoroughly; consider using <script> with setup() function as fallback.
Install required peer dependencies: npm i cheerio html-minifier
Use const vuePlugin = require('esbuild-plugin-vue3') instead of import.Create a tsconfig.json in project root with paths, or pass alias option explicitly.