npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

vite-electron-simple

v1.0.8

Published

一款支持在 vite 构建工具下,实现 electron 的开发、构建引入的脚手架,同时支持单一浏览器环境的开发和构建。支持全量的 vite 以及 electron-builder 的全部功能。

Downloads

75

Readme

vite-electron-simple

介绍

一款支持在 vite 构建工具下,实现 electron 的开发、构建引入的脚手架,同时支持单一浏览器环境的开发和构建。支持全量的 vite 以及 electron-builder 的全部功能。

安装

npm install vite-electron-simple
## 或
ppm add vite-electron-simple
## 或
yarn add vite-electron-simple

使用说明

  1. 在项目根目录下安装该包后,使用 mv-cli build、mv-cli start 来替换 vite、vite build 命令。
  2. 在项目根目录下新建 builder.config.js | builder.config.ts 文件,详情请参考示例。
  3. 强烈建议开发时,主进程和渲染进程代码分开来写,不要混入在一起。
    // package.json

    ...
    "scripts": {
        "dev": "mv-cli start",      // 开发调试
        "build": "tsc -b && mv-cli build",  // 生产构建
    },
    ...

贡献

  1. Fork 本仓库
  2. 新建 feat/xxx 分支
  3. Push代码,并提交 Merge Request, 作者欢迎各位为此开源工具贡献一份力量~

示例

// builder.config.js

...
import path from 'path';
import { defineMvConfig } from 'vite-electron-simple';  // 可导入辅助函数来实现idea的提醒

export default () => defineMvConfig({
        privateConfig: {
            needElectron: true,  // 是否开启electron,当开启时,生产和打包均会添加electron,默认为开启。(非必填)
            tsMainConfigPath: path.resolve(__dirname, './tsconfig.main.json'),  // 当主进程 electron 的代码使用了 ts,那么该ts对应的tsconfig.json 的路径,反之可不传递此参数(采用绝对路径)(非必填)
            move: [         // 开启 electron 时,主进程ts环境下的一些非直接依赖的目录文件在打包时,ts不会去处理,因此需要手动将依赖的文件移动到指定的目录下 (非必填)
                {
                    from: 'electron/static',
                    to: 'dist_electron/static'
                }
            ],
            env: ['xxx'] // 开启 electron 时,主进程需要的环境变量文件路径,采用 dotenv 进行注入(非必填)
        },
        viteConfig: {
           // ... 其它参数,与 vite defineConfig 一致
        },
        electronBuilder: {
            // ... 其它参数 与 electron-builder 配置保持一致
        }
    });

Basic Common