tiny-vue/internals/unplugin-virtual-template/README.md

105 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

# @opentiny/unplugin-virtual-template
## Install
```bash
npm i @opentiny/unplugin-virtual-template
```
<details>
<summary>Vite</summary><br>
```ts
// vite.config.ts
import Starter from '@opentiny/unplugin-virtual-template/vite'
export default defineConfig({
plugins: [
Starter({ /* options */ }),
],
})
```
Example: [`playground/`](./playground/)
<br></details>
<details>
<summary>Rollup</summary><br>
```ts
// rollup.config.js
import Starter from '@opentiny/unplugin-virtual-template/rollup'
export default {
plugins: [
Starter({ /* options */ }),
],
}
```
<br></details>
<details>
<summary>Webpack</summary><br>
```ts
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('@opentiny/unplugin-virtual-template/webpack')({ /* options */ })
]
}
```
<br></details>
<details>
<summary>Nuxt</summary><br>
```ts
// nuxt.config.js
export default {
buildModules: [
['@opentiny/unplugin-virtual-template/nuxt', { /* options */ }],
],
}
```
> This module works for both Nuxt 2 and [Nuxt Vite](https://github.com/nuxt/vite)
<br></details>
<details>
<summary>Vue CLI</summary><br>
```ts
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('@opentiny/unplugin-virtual-template/webpack')({ /* options */ }),
],
},
}
```
<br></details>
<details>
<summary>esbuild</summary><br>
```ts
// esbuild.config.js
import { build } from 'esbuild'
import Starter from '@opentiny/unplugin-virtual-template/esbuild'
build({
plugins: [Starter()],
})
```
<br></details>