Registry / web-framework / esbuild-plugin-vue3

esbuild-plugin-vue3

JSON →
library0.5.1jsnpmunverified

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-vue3
INSTALL
IMPORT
SIG · ESBUILD-PLUGIN-VUE
E
esbuild-plugin-vue3
web-frameworkjavascriptv0.5.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–223 runs
build_error
glibc
node 18–223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (plugin function)
✓ import vuePlugin from 'esbuild-plugin-vue3'
✗ const vuePlugin = require('esbuild-plugin-vue3').default
The package is CJS; default export is obtained via require('esbuild-plugin-vue3').
default (plugin function) via require
✓ const vuePlugin = require('esbuild-plugin-vue3')
CJS require yields the default export directly.
TypeScript (type imports not provided)
✓ // No type exports; use // @ts-ignore if needed
Package does not export type definitions; use any or declare module.

Minimal esbuild setup using esbuild-plugin-vue3 to bundle a Vue 3 SFC entry point into a single JS file.

const esbuild = require('esbuild'); const vuePlugin = require('esbuild-plugin-vue3'); async function build() { await esbuild.build({ entryPoints: ['src/app.ts'], bundle: true, outfile: 'dist/app.js', plugins: [vuePlugin()], }); } build().catch(console.error);
Debug
Known issues
gotchaPlugin is not thoroughly tested; use at your own risk.
fix
Consider using more mature alternatives like @vitejs/plugin-vue or vue-loader for production.
affects: >=0.0.0
breakingVersion 0.5.1 changed the way HTML generation works: options.generateHTML now accepts a string or an object.
fix
If upgrading from 0.4.x, update the generateHTML option format.
affects: >=0.5.0
gotchaPath aliases from tsconfig.json are resolved automatically, but only if a tsconfig.json exists in the working directory.
fix
Ensure tsconfig.json is present or explicitly set the alias option.
affects: >=0.0.0
deprecatedscript setup support is still experimental and may have bugs or missing features.
fix
Test thoroughly; consider using <script> with setup() function as fallback.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'cheerio'
Missing optional peer dependency cheerio when using HTML generation.
fix
Install required peer dependencies: npm i cheerio html-minifier
TypeError: vuePlugin is not a function
Using ES import syntax with CJS package incorrectly.
fix
Use const vuePlugin = require('esbuild-plugin-vue3') instead of import.
Error: Could not resolve './App.vue' from 'src/main.ts'
Path alias not recognized due to missing tsconfig.json or incorrect alias configuration.
fix
Create a tsconfig.json in project root with paths, or pass alias option explicitly.
Upgrade
Version history
0.5.1latest on npm
Audit
Dependencies
cheeriooptionalrequired for parsing template and generating HTML
html-minifieroptionalrequired for minifying HTML output
pugoptionalrequired for Pug template support
sassoptionalrequired for SCSS/SASS style support
vuerequiredrequired for Vue 3 runtime
Agent activity
6 hits · last 30 days
node
6
Resources
esbuild-plugin-vue3 — npm install esbuild-plugin-vue3 · libregistry