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

1.5 KiB

@opentiny/unplugin-virtual-template

Install

npm i @opentiny/unplugin-virtual-template
Vite
// vite.config.ts
import Starter from '@opentiny/unplugin-virtual-template/vite'

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

Example: playground/


Rollup
// rollup.config.js
import Starter from '@opentiny/unplugin-virtual-template/rollup'

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


Webpack
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('@opentiny/unplugin-virtual-template/webpack')({ /* options */ })
  ]
}


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

This module works for both Nuxt 2 and Nuxt Vite


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


esbuild
// esbuild.config.js
import { build } from 'esbuild'
import Starter from '@opentiny/unplugin-virtual-template/esbuild'

build({
  plugins: [Starter()],
})