# vitetron

> Create and build electron project with vite and vue3

Latest version **0.0.2** (published 2020-10-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install vitetron
pnpm add vitetron
yarn add vitetron
bun add vitetron
```

Provides the command `vitetron`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2020-10-02 |
| First published | 2020-10-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 53.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | xland |
| Maintainers | xlandxland |
| Keywords | vite, electron, vue3 |

## Links

- npm: https://www.npmjs.com/package/vitetron
- Repository: https://github.com/xland/vitetron
- Homepage: https://github.com/xland/vitetron#readme
- Issues: https://github.com/xland/vitetron/issues
- npm.io page: https://npm.io/package/vitetron

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2020-10-02
- 0.0.1 — 2020-10-02

## README

# vitetron

Develop and build electron project with vite and vue3

## Install

```bash
$ yarn create vite-app project-name
$ cd project-name
$ yarn add vitetron --dev
$ yarn add electron --dev
$ yarn add electron-builder --dev
$ yarn add esbuild --dev
```

Add `background.ts` at the ./src folder

Set the file's content with:

```js
import { app, BrowserWindow } from "electron";
let win;
app.on("ready", () => {
  win = new BrowserWindow();
  vitetron.load(win, "index.html"); //vitetron will be injected automaticly.
});
```

add scripts to your package.json

```json
  "scripts": {
    "start": "vitetron start",
    "release": "vitetron release"
  }
```

run `yarn start` to develope,`yarn release` for build

## Config

Add `vitetron.config.js` at the root of the project

Set the file's content with

```js
module.exports = {
  main: "./src/background.ts",
  build: {
    appId: "com.xland.app",
    productName: "ViteElectron示例",
  },
  env: {
    dev: {
      SERVICE_BASE_URL: "https://dev.yourdomain.site",
    },
    test: {
      SERVICE_BASE_URL: "https://test.yourdomain.site",
    },
    release: {
      SERVICE_BASE_URL: "https://release.yourdomain.site",
    },
  },
};
```

### main

The entry file of the main process,`.js` and `.ts` file are supported

### build

The [electron-builder's config](https://www.electron.build/configuration/configuration)

### env

The customized definition of `process.env`

## todo：

主进程可以调试

vitetron 有 TS 的类型

vue-cli 移除了哪些依赖

测试一下包含外部引用的主进程入口程序

默认支持.js 和.ts 的入口文件

尽量把需要的库都给它装好

自动创建 script 命令

---
_Source: https://npm.io/package/vitetron · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
