unplugin-conditional-compilation
v0.1.7
Published
Similar to taro framework conditional compilation
Downloads
2
Maintainers
Readme
unplugin-conditional-compilation
Usage
Similar to taro framework conditional compilation
Install
# npm
npm i -D unplugin-conditional-compilation
# yarn
yarn add -D unplugin-conditional-compilation
# pnpm
pnpm add -D unplugin-conditional-compilation
// vite.config.ts
import Starter from 'unplugin-conditional-compilation/vite'
export default defineConfig({
plugins: [
Starter({
/* options */
}),
],
})
Example: playground/
// rollup.config.js
import Starter from 'unplugin-conditional-compilation/rollup'
export default {
plugins: [
Starter({
/* options */
}),
],
}
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-conditional-compilation/webpack')({
/* options */
}),
],
}
// nuxt.config.js
export default {
buildModules: [
[
'unplugin-conditional-compilation/nuxt',
{
/* options */
},
],
],
}
This module works for both Nuxt 2 and Nuxt Vite
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-conditional-compilation/webpack')({
/* options */
}),
],
},
}
// esbuild.config.js
import { build } from 'esbuild'
import Starter from 'unplugin-conditional-compilation/esbuild'
build({
plugins: [Starter()],
})