Registry / devops / unplugin-stencil

unplugin-stencil

JSON →
library0.4.1jsnpmunverified

An unplugin wrapper around the Stencil compiler for use with Vite, Webpack, Rollup, esbuild, Nuxt, and other build tools. Version 0.4.1 is the current stable release. It provides a unified plugin interface across multiple bundlers, enabling Stencil component compilation in non-Stencil projects. Key differentiators: supports source maps (since 0.4.0), serializes builds to prevent stale output, and works with Astro, rspack, and Vue CLI. Peer dependencies include @stencil/core ^4.29.3 and various build tool versions. Release cadence is irregular; latest fixes address process.exit in writeBundle and Windows path support.

npm install unplugin-stencil
INSTALL
IMPORT
SIG · UNPLUGIN-STENCIL
U
unplugin-stencil
devopsjavascriptv0.4.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

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

default (vite plugin)
import stencil from 'unplugin-stencil/vite'
import stencil from 'unplugin-stencil'
Must use subpath import for specific bundler (e.g., '/vite', '/rollup', '/webpack', '/esbuild').
default (rollup plugin)
import stencil from 'unplugin-stencil/rollup'
const stencil = require('unplugin-stencil/rollup') (CJS works but TS may need esModuleInterop)
default (webpack plugin)
const stencil = require('unplugin-stencil/webpack')
import stencil from 'unplugin-stencil/webpack' (if using ESM webpack config, use dynamic import)
Nuxt module
['unplugin-stencil/nuxt', { /* options */ }]
import stencil from 'unplugin-stencil/nuxt' (used as array in nuxt.config modules)
Not a standard import; used as a module entry in nuxt.config.

Shows how to integrate unplugin-stencil with Vite using TypeScript. The plugin accepts Stencil compiler options as an argument.

// vite.config.ts import { defineConfig } from 'vite'; import stencil from 'unplugin-stencil/vite'; export default defineConfig({ plugins: [ stencil({ // Stencil compiler options (e.g., src: 'src/components', namespace: 'my-lib') }), ], });
Debug
Known issues
breakingIn version 0.3.0, `ensureFreshBuild` was renamed to `getLatestBuild` and the build system switched to event-driven queue.
fix
Update any custom build logic to use `getLatestBuild` and adjust for event-driven queue pattern.
affects: >=0.3.0 <0.3.0
deprecatedNuxt 2 support is deprecated and may be removed in future versions.
fix
Migrate to Nuxt 3 if possible.
affects: >=0.2.9
gotchaOn Windows, path transformations may fail before version 0.3.4. Ensure you use >=0.3.4 for Windows support.
fix
Upgrade to version 0.3.4 or later.
affects: <0.3.4
breakingIn version 0.2.9, the ESM import issue with @stencil/core was fixed. Users on <0.2.9 may encounter ESM import errors.
fix
Upgrade to 0.2.9 or later.
affects: <0.2.9
Errors
Common errors & fixes
Error: Cannot find module 'unplugin-stencil/vite'
Incorrect import path; subpath '/vite' missing.
fix
Ensure you have installed the package: npm install unplugin-stencil and use import stencil from 'unplugin-stencil/vite'.
TypeError: stencil is not a function
Importing default export without calling it as a function.
fix
Use stencil({ options }) as a function call in your plugins array.
Error: process.exit is not a function in writeBundle hook (v0.4.0)
Bug in version 0.4.0 where process.exit was called incorrectly.
fix
Upgrade to 0.4.1 which fixes this issue.
Upgrade
Version history
0.4.1latest on npm
Audit
Dependencies
@stencil/corerequiredRuntime dependency for Stencil compilation
viteoptionalRequired when using Vite plugin (>=3)
webpackoptionalRequired when using webpack plugin (^4 or ^5)
rollupoptionalRequired when using Rollup plugin (^3)
@nuxt/kitoptionalRequired when using Nuxt module (^3)
esbuildoptionalRequired when using esbuild plugin
Agent activity
2 hits · last 30 days
node
2
Resources
unplugin-stencil — npm install unplugin-stencil · libregistry