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 2467728 commit 94a369a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 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
6 changes: 6 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import path from 'path'
import legacy from '@vitejs/plugin-legacy'

// https://vitejs.dev/config/
export default defineConfig({
Expand All @@ -11,6 +12,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 94a369a

Please sign in to comment.