Registry / devops / millken-esbuild-plugin-vue

millken-esbuild-plugin-vue

JSON →
library0.9.4jsnpmunverified

An esbuild plugin for compiling Vue 3 Single File Components (SFC) during bundling. Current stable version 0.9.4, released as a standalone package maintained by millken. It supports TypeScript, CSS preprocessors (Sass, Less, Stylus), scoped CSS, CSS Modules, source maps, and template expressions with full error handling. Differentiators include zero-config integration with esbuild, reliance on Vite's Vue compiler infrastructure, and simple API with minimal boilerplate. Requires esbuild >=0.25.0 and Vue >=3.5.0 as peer dependencies.

npm install millken-esbuild-plugin-vue
INSTALL
IMPORT
SIG · MILLKEN-ESBUILD-PL
M
millken-esbuild-plugin-vue
devopsjavascriptv0.9.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

default
import vuePlugin from 'millken-esbuild-plugin-vue'
const vuePlugin = require('millken-esbuild-plugin-vue')
ESM-only package; CommonJS require will fail. The default export is a function that returns a plugin object.
VuePluginOptions
import type { VuePluginOptions } from 'millken-esbuild-plugin-vue'
import { VuePluginOptions } from 'millken-esbuild-plugin-vue'
Type-only import to avoid runtime inclusion. Interface is exported for TypeScript users.
vuePlugin
import vuePlugin from 'millken-esbuild-plugin-vue'; vuePlugin({...})
import { vuePlugin } from 'millken-esbuild-plugin-vue'
The plugin is exported as default, not named. A common mistake is using named import syntax.

Shows how to enable the Vue SFC plugin in an esbuild build script with TypeScript, source maps, and SCSS preprocessing.

import { build } from 'esbuild'; import vuePlugin from 'millken-esbuild-plugin-vue'; await build({ entryPoints: ['src/main.ts'], bundle: true, outfile: 'dist/main.js', plugins: [ vuePlugin({ sourceMap: true, isProduction: process.env.NODE_ENV === 'production', template: { compilerOptions: { compilerPreset: 'default', }, }, style: { preprocessLang: 'scss', }, }), ], });
Debug
Known issues
breakingVersion 0.9.0 dropped support for esbuild <0.25.0 and Vue <3.5.0.
fix
Upgrade esbuild to >=0.25.0 and Vue to >=3.5.0.
affects: >=0.9.0
deprecatedThe option 'style.preprocessLang' is deprecated in favor of passing style options directly to esbuild's CSS handling.
fix
Use esbuild's built-in CSS preprocessing or configure via vuePlugin({ style: { ... } }).
affects: >=0.8.0
gotchaPlugin must be installed as a direct dependency, not devDependency, because esbuild loads it at runtime.
fix
Run 'npm install millken-esbuild-plugin-vue --save' (not --save-dev).
affects: >=0.0.1
gotchaWhen using TypeScript in templates, ensure @vue/compiler-sfc is installed as a dependency.
fix
Run 'npm install @vue/compiler-sfc'.
affects: >=0.0.1
breakingVersion 0.7.0 changed the default export from a class to a function.
fix
Use vuePlugin({...}) instead of new VuePlugin({...}).
affects: >=0.7.0 <0.7.0
deprecatedThe option 'isProduction' is now automatically inferred if NODE_ENV is set.
fix
Remove isProduction option; set NODE_ENV=production instead.
affects: >=0.9.0
Errors
Common errors & fixes
Error: Cannot find module '@vue/compiler-sfc'
Missing peer dependency when using TypeScript in templates.
fix
npm install @vue/compiler-sfc
Error: The plugin 'vue' is not compatible with esbuild version 0.24.0
Plugin requires esbuild >=0.25.0.
fix
npm install esbuild@latest
TypeError: vuePlugin is not a function
Using named import instead of default import.
fix
Change to: import vuePlugin from 'millken-esbuild-plugin-vue'
Error: You are using the runtime-only build of Vue, but this plugin requires the compiler build.
Vue installation missing compiler runtime (e.g., vue.runtime.esm-bundler.js).
fix
Use the full build: in Vue 3, ensure 'vue' package includes compiler (default build).
Upgrade
Version history
0.9.4latest on npm
Audit
Dependencies
esbuildrequiredPeer dependency with version >=0.25.0; the plugin hooks into esbuild's plugin system
vuerequiredPeer dependency with version >=3.5.0; provides runtime for Vue SFC compilation
Agent activity
2 hits · last 30 days
node
2
Resources