@nemigo/electron 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ import type { AliasOptions } from "vite";
2
+ export interface ElectronViteConfigOptions {
3
+ isDEV: boolean;
4
+ node: number;
5
+ alias?: AliasOptions;
6
+ }
7
+ export declare const defineElectronViteConfig: (options: ElectronViteConfigOptions) => import("vite").UserConfig;
@@ -0,0 +1,27 @@
1
+ import { electronViteHotReboot } from "./hot-reboot.js";
2
+ import { defineConfig } from "vite";
3
+ export const defineElectronViteConfig = (options) => defineConfig({
4
+ resolve: {
5
+ alias: options.alias,
6
+ },
7
+ build: {
8
+ ssr: true,
9
+ minify: options.isDEV ? false : "esbuild",
10
+ sourcemap: options.isDEV ? "inline" : false,
11
+ target: `node${options.node}`,
12
+ lib: {
13
+ entry: [
14
+ "src/index.ts",
15
+ ],
16
+ formats: ["es"],
17
+ },
18
+ rollupOptions: {
19
+ output: {
20
+ entryFileNames: "[name].js",
21
+ },
22
+ },
23
+ emptyOutDir: true,
24
+ reportCompressedSize: false,
25
+ },
26
+ plugins: options.isDEV ? [electronViteHotReboot()] : [],
27
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nemigo/electron",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
5
  "author": {
6
6
  "name": "Vlad Logvin",
@@ -14,13 +14,17 @@
14
14
  "format": "prettier --write ./"
15
15
  },
16
16
  "exports": {
17
- "./vite/hot-reboot": {
18
- "types": "./dist/vite/hot-reboot.d.ts",
19
- "default": "./dist/vite/hot-reboot.js"
20
- },
21
17
  "./security": {
22
18
  "types": "./dist/security.d.ts",
23
19
  "default": "./dist/security.js"
20
+ },
21
+ "./vite": {
22
+ "types": "./dist/vite/index.d.ts",
23
+ "default": "./dist/vite/index.js"
24
+ },
25
+ "./vite/hot-reboot": {
26
+ "types": "./dist/vite/hot-reboot.d.ts",
27
+ "default": "./dist/vite/hot-reboot.js"
24
28
  }
25
29
  },
26
30
  "peerDependencies": {