From 8ec0fd7076b969574e137a25b712644085e94dcc Mon Sep 17 00:00:00 2001 From: viktorstrate Date: Fri, 21 May 2021 09:55:45 +0200 Subject: [PATCH] Replace esbuild with vite --- ui/example.env | 2 +- ui/{src => }/index.html | 8 +- ui/package-lock.json | 196 +++++++++++++++++- ui/package.json | 9 +- ui/src/apolloClient.ts | 4 +- .../{AlbumFilter.js => AlbumFilter.jsx} | 0 ...MessageProgress.js => MessageProgress.jsx} | 0 .../messages/{Messages.js => Messages.jsx} | 0 ui/src/localization.ts | 2 +- ui/src/registerServiceWorker.js | 2 +- ui/tsconfig.json | 30 +-- ui/vite.config.ts | 7 + 12 files changed, 228 insertions(+), 32 deletions(-) rename ui/{src => }/index.html (65%) rename ui/src/components/{AlbumFilter.js => AlbumFilter.jsx} (100%) rename ui/src/components/messages/{MessageProgress.js => MessageProgress.jsx} (100%) rename ui/src/components/messages/{Messages.js => Messages.jsx} (100%) create mode 100644 ui/vite.config.ts diff --git a/ui/example.env b/ui/example.env index 7f0ec5d7..015b0e05 100644 --- a/ui/example.env +++ b/ui/example.env @@ -1 +1 @@ -PHOTOVIEW_API_ENDPOINT=http://localhost:4001/ \ No newline at end of file +VITE_API_ENDPOINT=http://localhost:4001/ \ No newline at end of file diff --git a/ui/src/index.html b/ui/index.html similarity index 65% rename from ui/src/index.html rename to ui/index.html index 638830f8..8387fcfa 100644 --- a/ui/src/index.html +++ b/ui/index.html @@ -3,17 +3,17 @@ - - + - +
- + diff --git a/ui/package-lock.json b/ui/package-lock.json index 93731099..2212f2ad 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -67,12 +67,14 @@ "@types/url-join": "^4.0.0", "@typescript-eslint/eslint-plugin": "^4.23.0", "@typescript-eslint/parser": "^4.23.0", + "@vitejs/plugin-react-refresh": "^1.3.3", "eslint-config-prettier": "^8.3.0", "husky": "^6.0.0", "jest": "^26.6.3", "lint-staged": "^11.0.0", "prettier": "^2.3.0", - "tsc-files": "^1.1.2" + "tsc-files": "^1.1.2", + "vite": "^2.3.3" } }, "node_modules/@apollo/client": { @@ -1136,6 +1138,30 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.12.13.tgz", + "integrity": "sha512-FXYw98TTJ125GVCCkFLZXlZ1qGcsYqNQhVBQcZjyrwf8FEUtVfKIoidnO8S0q+KBQpDYNTmiGo1gn67Vti04lQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.14.2.tgz", + "integrity": "sha512-OMorspVyjxghAjzgeAWc6O7W7vHbJhV69NeTGdl9Mxgz6PaweAuo7ffB9T5A1OQ9dGcw0As4SYMUhyNC4u7mVg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-transform-react-pure-annotations": { "version": "7.12.1", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.12.1.tgz", @@ -3215,6 +3241,21 @@ "node": ">=10" } }, + "node_modules/@vitejs/plugin-react-refresh": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react-refresh/-/plugin-react-refresh-1.3.3.tgz", + "integrity": "sha512-J3KFwSQKrEK7fgOwTx0PMTlsolZORUch6BswjsM50q+Y7zSvX1ROIRn+tK2VE8SCvbYRHtzEKFlYW3vsWyTosQ==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.13", + "@babel/plugin-transform-react-jsx-self": "^7.12.13", + "@babel/plugin-transform-react-jsx-source": "^7.12.13", + "react-refresh": "^0.9.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/@wry/context": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.6.0.tgz", @@ -5282,9 +5323,9 @@ } }, "node_modules/esbuild": { - "version": "0.11.20", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.11.20.tgz", - "integrity": "sha512-QOZrVpN/Yz74xfat0H6euSgn3RnwLevY1mJTEXneukz1ln9qB+ieaerRMzSeETpz/UJWsBMzRVR/andBht5WKw==", + "version": "0.11.23", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.11.23.tgz", + "integrity": "sha512-iaiZZ9vUF5wJV8ob1tl+5aJTrwDczlvGP0JoMmnpC2B0ppiMCu8n8gmy5ZTGl5bcG081XBVn+U+jP+mPFm5T5Q==", "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -10598,6 +10639,18 @@ "resolved": "https://registry.npmjs.org/murmurhash-js/-/murmurhash-js-1.0.0.tgz", "integrity": "sha1-sGJ44h/Gw3+lMTcysEEry2rhX1E=" }, + "node_modules/nanoid": { + "version": "3.1.23", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", + "integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -11239,6 +11292,24 @@ "node": ">=0.10.0" } }, + "node_modules/postcss": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.0.tgz", + "integrity": "sha512-+ogXpdAjWGa+fdYY5BQ96V/6tAo+TdSSIMP5huJBIygdWwKtVoB5JWZ7yUd4xZ8r+8Kvvx4nyg/PQ071H4UtcQ==", + "dev": true, + "dependencies": { + "colorette": "^1.2.2", + "nanoid": "^3.1.23", + "source-map-js": "^0.6.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + } + }, "node_modules/potpack": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.1.tgz", @@ -11513,6 +11584,15 @@ "react": "^16.8.0 || ^17" } }, + "node_modules/react-refresh": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.9.0.tgz", + "integrity": "sha512-Gvzk7OZpiqKSkxsQvO/mbTN1poglhmAV7gR/DdIrRrSMXraRQQlfikRJOr3Nb9GTMPC5kof948Zy6jJZIFtDvQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/react-router": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz", @@ -12809,6 +12889,15 @@ "node": ">=0.10.0" } }, + "node_modules/source-map-js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-0.6.2.tgz", + "integrity": "sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-resolve": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", @@ -14002,6 +14091,27 @@ "extsprintf": "^1.2.0" } }, + "node_modules/vite": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-2.3.3.tgz", + "integrity": "sha512-eO1iwRbn3/BfkNVMNJDeANAFCZ5NobYOFPu7IqfY7DcI7I9nFGjJIZid0EViTmLDGwwSUPmRAq3cRBbO3+DsMA==", + "dev": true, + "dependencies": { + "esbuild": "^0.11.23", + "postcss": "^8.2.10", + "resolve": "^1.19.0", + "rollup": "^2.38.5" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": ">=12.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.1" + } + }, "node_modules/void-elements": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", @@ -15334,6 +15444,24 @@ "@babel/plugin-transform-react-jsx": "^7.12.17" } }, + "@babel/plugin-transform-react-jsx-self": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.12.13.tgz", + "integrity": "sha512-FXYw98TTJ125GVCCkFLZXlZ1qGcsYqNQhVBQcZjyrwf8FEUtVfKIoidnO8S0q+KBQpDYNTmiGo1gn67Vti04lQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + } + }, + "@babel/plugin-transform-react-jsx-source": { + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.14.2.tgz", + "integrity": "sha512-OMorspVyjxghAjzgeAWc6O7W7vHbJhV69NeTGdl9Mxgz6PaweAuo7ffB9T5A1OQ9dGcw0As4SYMUhyNC4u7mVg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0" + } + }, "@babel/plugin-transform-react-pure-annotations": { "version": "7.12.1", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.12.1.tgz", @@ -17032,6 +17160,18 @@ } } }, + "@vitejs/plugin-react-refresh": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react-refresh/-/plugin-react-refresh-1.3.3.tgz", + "integrity": "sha512-J3KFwSQKrEK7fgOwTx0PMTlsolZORUch6BswjsM50q+Y7zSvX1ROIRn+tK2VE8SCvbYRHtzEKFlYW3vsWyTosQ==", + "dev": true, + "requires": { + "@babel/core": "^7.12.13", + "@babel/plugin-transform-react-jsx-self": "^7.12.13", + "@babel/plugin-transform-react-jsx-source": "^7.12.13", + "react-refresh": "^0.9.0" + } + }, "@wry/context": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.6.0.tgz", @@ -18704,9 +18844,9 @@ } }, "esbuild": { - "version": "0.11.20", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.11.20.tgz", - "integrity": "sha512-QOZrVpN/Yz74xfat0H6euSgn3RnwLevY1mJTEXneukz1ln9qB+ieaerRMzSeETpz/UJWsBMzRVR/andBht5WKw==" + "version": "0.11.23", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.11.23.tgz", + "integrity": "sha512-iaiZZ9vUF5wJV8ob1tl+5aJTrwDczlvGP0JoMmnpC2B0ppiMCu8n8gmy5ZTGl5bcG081XBVn+U+jP+mPFm5T5Q==" }, "esbuild-plugin-babel": { "version": "0.2.3", @@ -22806,6 +22946,12 @@ "resolved": "https://registry.npmjs.org/murmurhash-js/-/murmurhash-js-1.0.0.tgz", "integrity": "sha1-sGJ44h/Gw3+lMTcysEEry2rhX1E=" }, + "nanoid": { + "version": "3.1.23", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", + "integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==", + "dev": true + }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -23291,6 +23437,17 @@ "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" }, + "postcss": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.0.tgz", + "integrity": "sha512-+ogXpdAjWGa+fdYY5BQ96V/6tAo+TdSSIMP5huJBIygdWwKtVoB5JWZ7yUd4xZ8r+8Kvvx4nyg/PQ071H4UtcQ==", + "dev": true, + "requires": { + "colorette": "^1.2.2", + "nanoid": "^3.1.23", + "source-map-js": "^0.6.2" + } + }, "potpack": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.1.tgz", @@ -23500,6 +23657,12 @@ "warning": "^4.0.2" } }, + "react-refresh": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.9.0.tgz", + "integrity": "sha512-Gvzk7OZpiqKSkxsQvO/mbTN1poglhmAV7gR/DdIrRrSMXraRQQlfikRJOr3Nb9GTMPC5kof948Zy6jJZIFtDvQ==", + "dev": true + }, "react-router": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz", @@ -24593,6 +24756,12 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" }, + "source-map-js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-0.6.2.tgz", + "integrity": "sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==", + "dev": true + }, "source-map-resolve": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", @@ -25530,6 +25699,19 @@ "extsprintf": "^1.2.0" } }, + "vite": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-2.3.3.tgz", + "integrity": "sha512-eO1iwRbn3/BfkNVMNJDeANAFCZ5NobYOFPu7IqfY7DcI7I9nFGjJIZid0EViTmLDGwwSUPmRAq3cRBbO3+DsMA==", + "dev": true, + "requires": { + "esbuild": "^0.11.23", + "fsevents": "~2.3.1", + "postcss": "^8.2.10", + "resolve": "^1.19.0", + "rollup": "^2.38.5" + } + }, "void-elements": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", diff --git a/ui/package.json b/ui/package.json index a7eb457d..d27c0c42 100644 --- a/ui/package.json +++ b/ui/package.json @@ -51,8 +51,9 @@ "workbox-build": "^6.1.5" }, "scripts": { - "start": "node --experimental-modules build.mjs watch", - "build": "NODE_ENV=production node --experimental-modules build.mjs", + "start": "vite", + "build": "vite build", + "serve": "vite preview", "test": "npm run lint && npm run jest", "test:ci": "npm run lint && npm run jest:ci", "lint": "npm run lint:types & npm run lint:eslint", @@ -80,12 +81,14 @@ "@types/url-join": "^4.0.0", "@typescript-eslint/eslint-plugin": "^4.23.0", "@typescript-eslint/parser": "^4.23.0", + "@vitejs/plugin-react-refresh": "^1.3.3", "eslint-config-prettier": "^8.3.0", "husky": "^6.0.0", "jest": "^26.6.3", "lint-staged": "^11.0.0", "prettier": "^2.3.0", - "tsc-files": "^1.1.2" + "tsc-files": "^1.1.2", + "vite": "^2.3.3" }, "cache": { "swDest": "service-worker.js" diff --git a/ui/src/apolloClient.ts b/ui/src/apolloClient.ts index c239aa88..e82ade28 100644 --- a/ui/src/apolloClient.ts +++ b/ui/src/apolloClient.ts @@ -16,8 +16,8 @@ import { clearTokenCookie } from './helpers/authentication' import { MessageState } from './components/messages/Messages' import { Message } from './components/messages/SubscriptionsHook' -export const GRAPHQL_ENDPOINT = process.env.PHOTOVIEW_API_ENDPOINT - ? urlJoin(process.env.PHOTOVIEW_API_ENDPOINT, '/graphql') +export const GRAPHQL_ENDPOINT = import.meta.env.VITE_API_ENDPOINT + ? urlJoin(import.meta.env.VITE_API_ENDPOINT as string, '/graphql') : urlJoin(location.origin, '/api/graphql') const httpLink = new HttpLink({ diff --git a/ui/src/components/AlbumFilter.js b/ui/src/components/AlbumFilter.jsx similarity index 100% rename from ui/src/components/AlbumFilter.js rename to ui/src/components/AlbumFilter.jsx diff --git a/ui/src/components/messages/MessageProgress.js b/ui/src/components/messages/MessageProgress.jsx similarity index 100% rename from ui/src/components/messages/MessageProgress.js rename to ui/src/components/messages/MessageProgress.jsx diff --git a/ui/src/components/messages/Messages.js b/ui/src/components/messages/Messages.jsx similarity index 100% rename from ui/src/components/messages/Messages.js rename to ui/src/components/messages/Messages.jsx diff --git a/ui/src/localization.ts b/ui/src/localization.ts index 6d1b640c..6fc4167e 100644 --- a/ui/src/localization.ts +++ b/ui/src/localization.ts @@ -27,7 +27,7 @@ export function setupLocalization(): void { }, react: { - useSuspense: process.env.NODE_ENV === 'production', + useSuspense: import.meta.env.PROD, }, }) } diff --git a/ui/src/registerServiceWorker.js b/ui/src/registerServiceWorker.js index be7b80bf..8d78d3ba 100644 --- a/ui/src/registerServiceWorker.js +++ b/ui/src/registerServiceWorker.js @@ -8,7 +8,7 @@ // To learn more about the benefits of this model, read https://goo.gl/KwvDNy. // This link also includes instructions on opting out of this behavior. -const isProduction = process.env.NODE_ENV === 'production' +const isProduction = import.meta.env.PROD export default function register() { if (isProduction && 'serviceWorker' in navigator) { diff --git a/ui/tsconfig.json b/ui/tsconfig.json index fb059ea6..704aab57 100644 --- a/ui/tsconfig.json +++ b/ui/tsconfig.json @@ -4,15 +4,16 @@ /* Basic Options */ // "incremental": true /* Enable incremental compilation */, - "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, - "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, + "target": "ESNEXT" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, + "module": "ESNEXT" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, "lib": [ - "es2015", - "dom" + "DOM", + "DOM.Iterable", + "ESNext" ] /* Specify library files to be included in the compilation. */, "allowJs": true /* Allow javascript files to be compiled. */, // "checkJs": true, /* Report errors in .js files. */ - "jsx": "preserve" /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */, + "jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */, "resolveJsonModule": true, // "declaration": true, /* Generates corresponding '.d.ts' file. */ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ @@ -26,7 +27,7 @@ "noEmit": true /* Do not emit outputs. */, // "importHelpers": true, /* Import emit helpers from 'tslib'. */ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + "isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */, /* Strict Type-Checking Options */ "strict": true /* Enable all strict type-checking options. */, @@ -47,7 +48,7 @@ // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ @@ -55,9 +56,12 @@ "node_modules/@types", "./src/@types/" ] /* List of folders to include type definitions from. */, - "types": ["jest"], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, + "types": [ + "vite/client", + "jest" + ] /* Type declaration files to be included in compilation. */, + "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */, + "esModuleInterop": false /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ @@ -72,9 +76,9 @@ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ /* Advanced Options */ - "skipLibCheck": true /* Skip type checking of declaration files. */, + "skipLibCheck": false /* Skip type checking of declaration files. */, "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ }, - "include": ["src/**/*"], - "exclude": ["node_modules/**/*", "dist/**/*"] + "include": ["./src"], + "exclude": ["./node_modules", "./dist"] } diff --git a/ui/vite.config.ts b/ui/vite.config.ts new file mode 100644 index 00000000..84e5513a --- /dev/null +++ b/ui/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import reactRefresh from '@vitejs/plugin-react-refresh' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [reactRefresh()], +})