polyfill js for older browsers i guess

This commit is contained in:
Luna D. 2024-05-06 17:16:15 +02:00
parent 377317a26b
commit 6cf90203cb
No known key found for this signature in database
GPG key ID: 4B1C63448394F688
2 changed files with 4 additions and 19 deletions

View file

@ -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"]
}
}

View file

@ -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,