Skip to content

Commit

Permalink
Improve support for older browsers/devices
Browse files Browse the repository at this point in the history
Apply @vitejs/plugin-legacy to use polyfills with older and modern browsers
  • Loading branch information
stefanseifert committed Sep 25, 2024
1 parent 4bed102 commit 7e60c28
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 144 deletions.
8 changes: 4 additions & 4 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
>= 0.5%
last 2 major versions
not dead
Chrome >= 60
Firefox >= 60
Chrome >= 90
Firefox >= 91
Firefox ESR
iOS >= 12
Safari >= 12
iOS >= 15
Safari >= 15
not Explorer <= 11
180 changes: 43 additions & 137 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"generate-pwa-assets": "pwa-assets-generator"
},
"dependencies": {
"@brdgm/brdgm-commons": "^1.6.8",
"@brdgm/brdgm-commons": "^1.6.9",
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.3",
"core-js": "^3.38.1",
Expand Down Expand Up @@ -47,10 +47,10 @@
"eslint-plugin-vue": "^9.28.0",
"jsdom": "^25.0.1",
"nodemon": "^3.1.7",
"sass": "^1.78.0",
"sass": "~1.78.0",
"source-map-support": "^0.5.21",
"ts-node": "^10.9.2",
"typescript": "^5.5.4",
"typescript": "~5.5.4",
"vite": "^5.4.7",
"vite-plugin-pwa": "^0.20.5",
"vitest": "^2.1.1"
Expand Down
6 changes: 6 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { VitePWA } from 'vite-plugin-pwa'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import path from 'path'
import { description, appDeployName } from './package.json'
import legacy from '@vitejs/plugin-legacy'

// https://vitejs.dev/config/
export default defineConfig({
Expand Down Expand Up @@ -59,6 +60,11 @@ export default defineConfig({
VueI18nPlugin({
include: [path.resolve(__dirname, './src/locales/**')],
strictMessage: false
}),
// support older browsers
legacy({
modernTargets: 'iOS >= 15, Safari >= 15',
modernPolyfills: true
})
],
resolve: {
Expand Down

0 comments on commit 7e60c28

Please sign in to comment.