Skip to content

Files

Latest commit

 

History

History

plugin-vite

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

vite-plugin-doubleshot

Description

It's a Vite plugin with integrated @doubleshot/builder. You can use it to help Vite quickly build node backend or electron's main process code.

Warning: this project is in early stage, do not use in production environment

Install

npm i vite-plugin-doubleshot -D
# Or Yarn
yarn add vite-plugin-doubleshot -D
# Or PNPM
pnpm add vite-plugin-doubleshot -D

Usage

In Vite config file(eg. .vite.config.ts), add this plugin:

import { defineConfig } from 'vite'
import { VitePluginDoubleshot } from 'vite-plugin-doubleshot'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    VitePluginDoubleshot({
      type: 'electron',
      main: 'dist/main/index.js',
      entry: 'src/index.ts',
      outDir: 'dist/main',
      external: ['electron']
    }),
  ]
})

You can find more configurations through the type definition file.

License

MIT License © 2022 Archer Gu