unplugin-chii
v0.1.14
Published
Use chii for Vite and Webpack
Maintainers
Readme
unplugin-chii
Install
npm i unplugin-chiiOption
| name | type | description | | -------- | ------- | ----------- | | enable | boolean | | | port | number | | | host | string | | | domain | string | | | cdn | string | | | https | string | | | sslCert | string | | | sslKey | string | | | basePath | string | |
// vite.config.ts
import Starter from 'unplugin-chii/vite'
export default defineConfig({
plugins: [
Starter({
/* options */
}),
],
})Example: vite-playground/
You need to set
WEBPACK_SERVEenvironment 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.config.js
export default {
buildModules: [
[
'unplugin-chii/nuxt',
{
/* options */
},
],
],
}This module works for both Nuxt 2 and Nuxt Vite
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-chii/webpack')({
/* options */
}),
],
},
}