Skip to content

Commit

Permalink
Migrate to vite #220
Browse files Browse the repository at this point in the history
  • Loading branch information
domi-b authored Oct 10, 2024
2 parents a12d8fc + 12ae1de commit d167c4d
Show file tree
Hide file tree
Showing 21 changed files with 9,811 additions and 31,781 deletions.
17 changes: 17 additions & 0 deletions src/ILICheck.Web/ClientApp/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="icon" href="/favicon.ico" />
<link rel="shortcut icon" href="/favicon.ico">
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<script type="module" src="/src/index.jsx"></script>
</body>
</html>
41,487 changes: 9,761 additions & 31,726 deletions src/ILICheck.Web/ClientApp/package-lock.json

Large diffs are not rendered by default.

26 changes: 9 additions & 17 deletions src/ILICheck.Web/ClientApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "interlis-web-check-service",
"version": "0.1.0",
"private": true,
"type": "module",
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^11.2.7",
Expand All @@ -19,10 +20,10 @@
"web-vitals": "^1.1.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"dev": "vite",
"preview": "vite preview",
"build": "vite build",
"test": "vitest",
"lint": "eslint ./src/"
},
"eslintConfig": {
Expand All @@ -38,19 +39,8 @@
"prettier"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@vitejs/plugin-react": "^4.3.2",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.6.0",
"eslint-config-react-app": "^6.0.0",
Expand All @@ -59,7 +49,9 @@
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"jsdom": "^25.0.1",
"license-checker": "^25.0.1",
"react-scripts": "^5.0.1"
"vite": "^5.4.8",
"vitest": "^2.1.2"
}
}
35 changes: 0 additions & 35 deletions src/ILICheck.Web/ClientApp/public/index.html

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/ILICheck.Web/ClientApp/src/logHierarchy.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from "@jest/globals";
import { describe, expect, test } from "vitest";
import { createLogHierarchy } from "./logHierarchy";

describe("transform log data to hierarchy", () => {
Expand Down
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions src/ILICheck.Web/ClientApp/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

export default defineConfig({
build: {
outDir: "build",
},
plugins: [react()],
server: {
port: 3000,
},
test: {
globals: true,
environment: "jsdom",
css: true,
coverage: {
reporter: ["text", "json", "html"],
include: ["src/**/*"],
exclude: [],
},
},
});
3 changes: 1 addition & 2 deletions src/ILICheck.Web/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using Microsoft.AspNetCore.Mvc.Versioning;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
Expand Down Expand Up @@ -175,7 +174,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF

if (env.IsDevelopment())
{
spa.UseReactDevelopmentServer(npmScript: "start");
spa.UseProxyToSpaDevelopmentServer("http://localhost:3000");
}
});
}
Expand Down

0 comments on commit d167c4d

Please sign in to comment.