diff --git a/package.json b/package.json index 383d7b36ce7..d2e9c0a6eb2 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "vite:oc10": "OCIS=false vite" }, "browserslist": [ - "last 2 versions", + "last 1 year", "> .2%", "not dead", "not Explorer > 0", @@ -69,6 +69,7 @@ "autoprefixer": "10.4.13", "babel-core": "7.0.0-bridge.0", "babel-jest": "29.3.1", + "browserslist-to-esbuild": "^1.2.0", "browserslist-useragent-regexp": "^3.0.2", "commander": "8.3.0", "core-js": "3.26.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 20ee333f383..2971d86f07c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -40,6 +40,7 @@ importers: autoprefixer: 10.4.13 babel-core: 7.0.0-bridge.0 babel-jest: 29.3.1 + browserslist-to-esbuild: ^1.2.0 browserslist-useragent-regexp: ^3.0.2 caf: '*' commander: 8.3.0 @@ -126,6 +127,7 @@ importers: autoprefixer: 10.4.13_postcss@8.4.19 babel-core: 7.0.0-bridge.0_@babel+core@7.20.5 babel-jest: 29.3.1_@babel+core@7.20.5 + browserslist-to-esbuild: 1.2.0 browserslist-useragent-regexp: 3.0.2 commander: 8.3.0 core-js: 3.26.1 @@ -8071,6 +8073,13 @@ packages: pako: 1.0.11 dev: true + /browserslist-to-esbuild/1.2.0: + resolution: {integrity: sha512-ftrrbI/VHBgEnmnSyhkqvQVMp6jAKybfs0qMIlm7SLBrQTGMsdCIP4q3BoKeLsZTBQllIQtY9kbxgRYV2WU47g==} + engines: {node: '>=12'} + dependencies: + browserslist: 4.21.4 + dev: true + /browserslist-useragent-regexp/3.0.2: resolution: {integrity: sha512-hOvTo9ObY+2PvCLxydvam5WD9hlvWB4bFzRLxc/M5OdJfzjgfsQ9wEF7EpJJP7UJUAnKJdJK28XsSrl5d1DfoA==} engines: {node: '>=12.0.0'} diff --git a/vite.config.ts b/vite.config.ts index c013ef71776..a6923869703 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -14,6 +14,7 @@ import { existsSync, readdirSync, readFileSync } from 'fs' // build config import packageJson from './package.json' import { getUserAgentRegExp } from 'browserslist-useragent-regexp' +import browserslistToEsbuild from 'browserslist-to-esbuild' const buildConfig = { requirejs: {}, @@ -108,7 +109,8 @@ export default defineConfig(({ mode, command }) => { } } } - } + }, + target: browserslistToEsbuild() }, server: { host: 'host.docker.internal',