Upgraded to vite 5

This commit is contained in:
Oliver Schwendener 2024-01-09 14:35:35 +01:00
parent 0bfd426573
commit c7fb09291c
No known key found for this signature in database
GPG Key ID: 65FB86201210F104
4 changed files with 544 additions and 336 deletions

View File

@ -31,18 +31,18 @@
"@types/react-router-dom": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react": "^4.1.0",
"@vitest/coverage-v8": "^0.34.6",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^1.1.3",
"electron": "^28.1.1",
"electron-builder": "^24.9.1",
"eslint": "^8.44.0",
"prettier": "^3.0.2",
"prettier-plugin-organize-imports": "^3.2.3",
"typescript": "^5.1.3",
"vite": "^4.4.11",
"vite-plugin-electron": "^0.14.1",
"vite": "^5.0.11",
"vite-plugin-electron": "^0.28.0",
"vite-plugin-electron-renderer": "^0.14.5",
"vitest": "^0.34.6"
"vitest": "^1.1.3"
},
"dependencies": {
"@fluentui/react-components": "^9.42.0",

File diff suppressed because it is too large Load Diff

View File

@ -6,6 +6,7 @@
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"rootDir": "./src",
"skipLibCheck": true,
"paths": {
"@common/*": ["./src/common/*"],
"@Core/*": ["./src/main/Core/*"]

View File

@ -1,5 +1,4 @@
import react from "@vitejs/plugin-react";
import { rmSync } from "fs";
import { join } from "path";
import { defineConfig, type AliasOptions } from "vite";
import electron from "vite-plugin-electron";
@ -7,9 +6,6 @@ import renderer from "vite-plugin-electron-renderer";
import pkg from "./package.json";
export default defineConfig(({ command }) => {
rmSync("dist-main", { recursive: true, force: true });
rmSync("dist-preload", { recursive: true, force: true });
const isServe = command === "serve";
const isBuild = command === "build";
const sourcemap = isServe ? "inline" : undefined;
@ -17,6 +13,7 @@ export default defineConfig(({ command }) => {
const resolve: { alias: AliasOptions } = {
alias: {
"@common": join(__dirname, "src", "common"),
"@Core": join(__dirname, "src", "main", "Core"),
},
};
@ -25,6 +22,7 @@ export default defineConfig(({ command }) => {
resolve,
build: {
outDir: "../../dist-renderer",
emptyOutDir: true,
chunkSizeWarningLimit: 1000,
},
plugins: [
@ -41,6 +39,7 @@ export default defineConfig(({ command }) => {
sourcemap,
minify: isBuild,
outDir: "dist-main",
emptyOutDir: true,
rollupOptions: {
external: Object.keys("dependencies" in pkg ? pkg.dependencies : {}),
},
@ -60,6 +59,7 @@ export default defineConfig(({ command }) => {
sourcemap,
minify: isBuild,
outDir: "dist-preload",
emptyOutDir: true,
rollupOptions: {
external: Object.keys("dependencies" in pkg ? pkg.dependencies : {}),
},