diff --git a/site/package.json b/site/package.json index 2664945b3..72306bf52 100644 --- a/site/package.json +++ b/site/package.json @@ -110,6 +110,7 @@ "@types/styled-components": "^5.1.9", "@typescript-eslint/eslint-plugin": "^4.0.1", "@typescript-eslint/parser": "^4.0.1", + "@vitejs/plugin-legacy": "^1.6.4", "@vitejs/plugin-react": "^1.1.0", "babel-plugin-styled-components": "^1.10.7", "concurrently": "^6.0.2", diff --git a/site/source/pages/Stats/Chart.tsx b/site/source/pages/Stats/Chart.tsx index f14c6a9e8..c95c61ba0 100644 --- a/site/source/pages/Stats/Chart.tsx +++ b/site/source/pages/Stats/Chart.tsx @@ -235,4 +235,4 @@ const formatLegend = (key: string) => ? 'simulation commencée' : key === 'simulation_terminee' ? 'simulation terminée' - : key.replaceAll('_', ' ') + : key.replace(/_/g, ' ') diff --git a/site/vite.config.ts b/site/vite.config.ts index 081ab9cd3..8e2b74c70 100644 --- a/site/vite.config.ts +++ b/site/vite.config.ts @@ -1,8 +1,9 @@ import yaml from '@rollup/plugin-yaml' +import legacy from '@vitejs/plugin-legacy' import react from '@vitejs/plugin-react' +import { promises as fs } from 'fs' import path from 'path' import toml from 'rollup-plugin-toml' -import { promises as fs } from 'fs' import { defineConfig, Plugin } from 'vite' import { watchDottedNames } from '../modele-social/build.js' @@ -54,6 +55,9 @@ export default defineConfig({ }, }, }), + legacy({ + targets: ['defaults', 'not IE 11'], + }), ], })