From 6cf90203cb6350c093cb48b6132172099e8d34f0 Mon Sep 17 00:00:00 2001 From: "Luna D." Date: Mon, 6 May 2024 17:16:15 +0200 Subject: [PATCH] polyfill js for older browsers i guess --- assets/tsconfig.json | 10 +++------- assets/vite.config.ts | 13 +------------ 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/assets/tsconfig.json b/assets/tsconfig.json index 596469ea..e825a6a0 100644 --- a/assets/tsconfig.json +++ b/assets/tsconfig.json @@ -1,26 +1,22 @@ { "compilerOptions": { "baseUrl": "./js", - "target": "ES2020", + "target": "ES2016", "useDefineForClassFields": true, "esModuleInterop": true, "allowJs": true, "skipLibCheck": true, "lib": [ - "ES2020", + "ES2016", "DOM", "DOM.Iterable" ], - - "moduleResolution": "Node", + "moduleResolution": "bundler", "allowImportingTsExtensions": true, "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, - - "strict": true, - "types": ["vitest/globals"] } } diff --git a/assets/vite.config.ts b/assets/vite.config.ts index 914d4612..5b2a49c0 100644 --- a/assets/vite.config.ts +++ b/assets/vite.config.ts @@ -7,17 +7,6 @@ import { defineConfig, UserConfig, ConfigEnv } from 'vite'; export default defineConfig(({ command, mode }: ConfigEnv): UserConfig => { const isDev = command !== 'build' && mode !== 'test'; - if (isDev) { - // Terminate the watcher when Phoenix quits - // @see https://moroz.dev/blog/integrating-vite-js-with-phoenix-1-6 - process.stdin.on('close', () => { - // eslint-disable-next-line no-process-exit - process.exit(0); - }); - - process.stdin.resume(); - } - const themeNames = fs.readdirSync(path.resolve(__dirname, 'css/themes/')).map(name => { const m = name.match(/([-a-z]+).scss/); @@ -42,7 +31,7 @@ export default defineConfig(({ command, mode }: ConfigEnv): UserConfig => { } }, build: { - target: 'es2020', + target: ['es2016', 'chrome67', 'firefox62', 'edge18', 'safari12'], outDir: path.resolve(__dirname, '../priv/static'), emptyOutDir: false, sourcemap: isDev,