Vite Plugin Doubleshot
raw JSON → 0.0.22 verified Mon Apr 27 auth: no javascript
Vite plugin integrating @doubleshot/builder for building Node.js backend or Electron main process code with Vite. Version 0.0.22, early-stage (not production-ready). It leverages esbuild for fast bundling and supports TypeScript out of the box. Differentiators: unified configuration for Electron and NestJS projects, seamless Vite integration, and automatic external handling.
Common errors
error Cannot find module '@doubleshot/builder' ↓
cause Missing dependency @doubleshot/builder as a transitive dependency.
fix
Install @doubleshot/builder explicitly: npm install @doubleshot/builder -D
error Error: The plugin 'VitePluginDoubleshot' doesn't have a 'name' property ↓
cause The plugin object might be misconfigured or imported incorrectly.
fix
Ensure you are using the named export: import { VitePluginDoubleshot } from 'vite-plugin-doubleshot'
Warnings
gotcha Package is in early stage and not recommended for production use. ↓
fix Use other stable tools like electron-builder or electron-forge for production.
breaking The plugin may rename or change options in future versions (minor/patch). ↓
fix Pin a specific version and test upgrades carefully.
deprecated The `type` option might be renamed in the future (experimental). ↓
fix Watch the CHANGELOG for changes to configuration schema.
Install
npm install vite-plugin-doubleshot yarn add vite-plugin-doubleshot pnpm add vite-plugin-doubleshot Imports
- VitePluginDoubleshot wrong
const VitePluginDoubleshot = require('vite-plugin-doubleshot')correctimport { VitePluginDoubleshot } from 'vite-plugin-doubleshot'
Quickstart
// vite.config.ts
import { defineConfig } from 'vite'
import { VitePluginDoubleshot } from 'vite-plugin-doubleshot'
export default defineConfig({
plugins: [
VitePluginDoubleshot({
type: 'electron',
main: 'dist/main/index.js',
entry: 'src/index.ts',
outDir: 'dist/main',
external: ['electron']
})
]
})