@view-launcher/rollup-plugin

The rollup plugin of view-launcher for Vue

Usage no npm install needed!

<script type="module">
  import viewLauncherRollupPlugin from 'https://cdn.skypack.dev/@view-launcher/rollup-plugin';
</script>

README

@view-launcher/rollup-plugin

Rollup/Vite plugin for Vue.js SFC. Must be used along with rollup-plugin-vue.

Usage

Installation

npm i @view-launcher/rollup-plugin -D

Example rollup.config.js

import path from 'path'
import VuePlugin from 'rollup-plugin-vue'
import ViewLauncherVuePlugin from '@view-launcher/rollup-plugin'

const entryFile = path.resolve(__dirname, 'src/main.js')
const viewLauncherOptions = { 
  entry: entryFile,
  theme: 'light' 
}

export default {
  input: entryFile,
  output: {
    file: `./dist/main.js`,
    format: 'esm',
  },
  plugins: [
    ViewLauncherVuePlugin(viewLauncherOptions),
    VuePlugin()
  ],
  external: ['vue'],
}

Be sure that place this plugin after rollup-plugin-vue.

Example(Vite) vite.config.js

import path from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ViewLauncherVuePlugin from '@view-launcher/rollup-plugin'

const entryFile = path.resolve(__dirname, 'src/main.js')
const viewLauncherOptions = {
  entry: entryFile,
  theme: 'light'
}

export default defineConfig({
  plugins: [
    ViewLauncherVuePlugin(viewLauncherOptions),
    vue()
  ],
})

Be sure that place this plugin after @vitejs/plugin-vue.