stencil-community / unplugin-stencil

An Unplugin that wraps Stencil compiler for Vite, Webpack, Rollup, and more
https://stenciljs.com/
MIT License
6 stars 0 forks source link

Stencil Unplugin

NPM version

An unplugin that wraps the Stencil compiler to be used within Astro, Esbuild, Nuxt, Rollup, rspack, Vite and Webpack etc. environments.

Install

To install this unplugin, run:

npm i unplugin-stencil
Vite
```ts // vite.config.ts import stencil from 'unplugin-stencil/vite' export default defineConfig({ plugins: [ stencil({ /* Stencil configuration overwrites */ }), ], }) ```
Rollup
```ts // rollup.config.js import Starter from 'unplugin-stencil/rollup' export default { plugins: [ Starter({ /* options */ }), ], } ```
Webpack
```ts // webpack.config.js module.exports = { /* ... */ plugins: [ require('unplugin-stencil/webpack')({ /* options */ }) ] } ```
Nuxt
```ts // nuxt.config.js export default defineNuxtConfig({ modules: [ ['unplugin-stencil/nuxt', { /* options */ }], ], }) ``` > This module works for both Nuxt 2 and [Nuxt Vite](https://github.com/nuxt/vite)
Vue CLI
```ts // vue.config.js module.exports = { configureWebpack: { plugins: [ require('unplugin-stencil/webpack')({ /* options */ }), ], }, } ```
esbuild
```ts // esbuild.config.js import { build } from 'esbuild' import Starter from 'unplugin-stencil/esbuild' build({ plugins: [Starter()], }) ```