Skip to content

Binbiubiubiu/unplugin-chii

Repository files navigation

unplugin-chii

NPM version CI codecov

Install

npm i unplugin-chii

Option

name type description
enable boolean
port number
host string
domain string
cdn string
https string
sslCert string
sslKey string
basePath string
Vite
// vite.config.ts
import Starter from 'unplugin-chii/vite'

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

Example: vite-playground/


Webpack

You need to set WEBPACK_SERVE environment variable to non-falsy

// webpack.config.js
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
  /* ... */
  plugins: [
    new HtmlWebpackPlugin({
      template: 'index.html',
    }),
    require('unplugin-chii/webpack')({
      /* options */
    }),
  ],
}

Example: webpack-playground/


Nuxt
// nuxt.config.js
export default {
  buildModules: [
    [
      'unplugin-chii/nuxt',
      {
        /* options */
      },
    ],
  ],
}

This module works for both Nuxt 2 and Nuxt Vite


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