npm i unplugin-chii
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 */
}),
],
},
}