aboutsummaryrefslogtreecommitdiffstats
path: root/packages/main
diff options
context:
space:
mode:
Diffstat (limited to 'packages/main')
-rw-r--r--packages/main/package.json8
-rw-r--r--packages/main/tsconfig.json10
-rw-r--r--packages/main/types/vite-env.d.ts5
-rw-r--r--packages/main/vite.config.js6
4 files changed, 15 insertions, 14 deletions
diff --git a/packages/main/package.json b/packages/main/package.json
index 1eba6c1..11a6270 100644
--- a/packages/main/package.json
+++ b/packages/main/package.json
@@ -1,12 +1,20 @@
1{ 1{
2 "name": "@sophie/main", 2 "name": "@sophie/main",
3 "version": "0.1.0", 3 "version": "0.1.0",
4 "private": true,
5 "main": "dist/index.cjs",
6 "scripts": {
7 "build": "vite build",
8 "typecheck": "tsc --noEmit"
9 },
4 "dependencies": { 10 "dependencies": {
5 "electron": "^16.0.5" 11 "electron": "^16.0.5"
6 }, 12 },
7 "devDependencies": { 13 "devDependencies": {
8 "@types/electron-devtools-installer": "^2.2.0", 14 "@types/electron-devtools-installer": "^2.2.0",
15 "@types/node": "^16.11.15",
9 "electron-devtools-installer": "^3.2.0", 16 "electron-devtools-installer": "^3.2.0",
17 "typescript": "^4.5.4",
10 "vite": "^2.7.6" 18 "vite": "^2.7.6"
11 } 19 }
12} 20}
diff --git a/packages/main/tsconfig.json b/packages/main/tsconfig.json
index 7181228..1a569d2 100644
--- a/packages/main/tsconfig.json
+++ b/packages/main/tsconfig.json
@@ -1,19 +1,13 @@
1{ 1{
2 "extends": "../../tsconfig.json", 2 "extends": "../../tsconfig.json",
3 "compilerOptions": { 3 "compilerOptions": {
4 "baseUrl": ".",
5 "paths": {
6 "/@/*": [
7 "src/*"
8 ]
9 },
10 "types": [ 4 "types": [
11 "node", 5 "node",
12 "vite/client" 6 "vite/client"
13 ] 7 ]
14 }, 8 },
15 "include": [ 9 "include": [
16 "src/**/*", 10 "src/**/*.ts",
17 "../../types/**/*.d.ts" 11 "types/**/*.d.ts"
18 ] 12 ]
19} 13}
diff --git a/packages/main/types/vite-env.d.ts b/packages/main/types/vite-env.d.ts
new file mode 100644
index 0000000..c6d56a6
--- /dev/null
+++ b/packages/main/types/vite-env.d.ts
@@ -0,0 +1,5 @@
1/// <reference types="vite/client" />
2
3interface ImportMetaEnv {
4 VITE_DEV_SERVER_URL: string | undefined;
5}
diff --git a/packages/main/vite.config.js b/packages/main/vite.config.js
index 45c2c8c..556fcf8 100644
--- a/packages/main/vite.config.js
+++ b/packages/main/vite.config.js
@@ -1,7 +1,6 @@
1// @ts-check 1// @ts-check
2 2
3import { builtinModules } from 'module'; 3import { builtinModules } from 'module';
4import { join } from 'path';
5 4
6// `resolveJsonModule` is disabled for this package, but vite will load the json nevertheless. 5// `resolveJsonModule` is disabled for this package, but vite will load the json nevertheless.
7// @ts-expect-error 6// @ts-expect-error
@@ -18,11 +17,6 @@ const config = {
18 mode: process.env.MODE, 17 mode: process.env.MODE,
19 root: PACKAGE_ROOT, 18 root: PACKAGE_ROOT,
20 envDir: process.cwd(), 19 envDir: process.cwd(),
21 resolve: {
22 alias: {
23 '/@/': join(PACKAGE_ROOT, 'src') + '/',
24 },
25 },
26 build: { 20 build: {
27 sourcemap: 'inline', 21 sourcemap: 'inline',
28 target: `node${node}`, 22 target: `node${node}`,