Skip to content

Repository files navigation

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 @stencil-community/unplugin-stencil
Vite
// vite.config.ts
import stencil from '@stencil-community/unplugin-stencil/vite'

export default defineConfig({
  plugins: [
    stencil({ /* Stencil configuration overwrites */ }),
  ],
})


Rollup
// rollup.config.js
import Starter from '@stencil-community/unplugin-stencil/rollup'

export default {
  plugins: [
    Starter({ /* options */ }),
  ],
}


Webpack
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('@stencil-community/unplugin-stencil/webpack')({ /* options */ })
  ]
}


Nuxt
// nuxt.config.js
export default defineNuxtConfig({
  modules: [
    ['@stencil-community/unplugin-stencil/nuxt', { /* options */ }],
  ],
})

This module works for both Nuxt 2 and Nuxt Vite


Vue CLI
// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('@stencil-community/unplugin-stencil/webpack')({ /* options */ }),
    ],
  },
}


esbuild
// esbuild.config.js
import Starter from '@stencil-community/unplugin-stencil/esbuild'
import { build } from 'esbuild'

build({
  plugins: [Starter()],
})


About

An Unplugin that wraps Stencil compiler for Vite, Webpack, Rollup, and more

Resources

Stars

17 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages