Makes Vite use browserslist (#38777)
This commit is contained in:
parent
5b1891a1ae
commit
c4eec632b9
@ -6,6 +6,7 @@ import { optimizeLodashImports } from '@optimize-lodash/rollup-plugin';
|
|||||||
import babel from '@rolldown/plugin-babel';
|
import babel from '@rolldown/plugin-babel';
|
||||||
import legacy from '@vitejs/plugin-legacy';
|
import legacy from '@vitejs/plugin-legacy';
|
||||||
import react from '@vitejs/plugin-react';
|
import react from '@vitejs/plugin-react';
|
||||||
|
import browserslist from 'browserslist';
|
||||||
import postcssPresetEnv from 'postcss-preset-env';
|
import postcssPresetEnv from 'postcss-preset-env';
|
||||||
import Compress from 'rollup-plugin-gzip';
|
import Compress from 'rollup-plugin-gzip';
|
||||||
import { visualizer } from 'rollup-plugin-visualizer';
|
import { visualizer } from 'rollup-plugin-visualizer';
|
||||||
@ -182,6 +183,7 @@ export const config: UserConfigFnPromise = async ({ mode, command }) => {
|
|||||||
legacy({
|
legacy({
|
||||||
renderLegacyChunks: false,
|
renderLegacyChunks: false,
|
||||||
modernPolyfills: true,
|
modernPolyfills: true,
|
||||||
|
modernTargets: browserslist.loadConfig({ path: process.cwd() }),
|
||||||
}),
|
}),
|
||||||
isProdBuild && (Compress() as PluginOption),
|
isProdBuild && (Compress() as PluginOption),
|
||||||
command === 'build' &&
|
command === 'build' &&
|
||||||
|
|||||||
14
yarn.lock
14
yarn.lock
@ -5907,11 +5907,11 @@ __metadata:
|
|||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"baseline-browser-mapping@npm:^2.9.0":
|
"baseline-browser-mapping@npm:^2.9.0":
|
||||||
version: 2.9.2
|
version: 2.10.20
|
||||||
resolution: "baseline-browser-mapping@npm:2.9.2"
|
resolution: "baseline-browser-mapping@npm:2.10.20"
|
||||||
bin:
|
bin:
|
||||||
baseline-browser-mapping: dist/cli.js
|
baseline-browser-mapping: dist/cli.cjs
|
||||||
checksum: 10c0/4f9be09e20261ed26f19e9b95454dcb8d8371b87983c57cd9f70b9572e9b3053577f0d8d6d91297bdb605337747680686e22f62522a6e57ae2488fcacf641188
|
checksum: 10c0/3d60c9656c4c4673593aa8d0ae9aa6b69b4e018c2f585874a0e8a40cb28d0559f57ee1b2e7e44cb1e7f6aac66f658a4a3c1285901b8836d8ae31e189e30aa816
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@ -6140,9 +6140,9 @@ __metadata:
|
|||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"caniuse-lite@npm:^1.0.30001759, caniuse-lite@npm:^1.0.30001766":
|
"caniuse-lite@npm:^1.0.30001759, caniuse-lite@npm:^1.0.30001766":
|
||||||
version: 1.0.30001770
|
version: 1.0.30001790
|
||||||
resolution: "caniuse-lite@npm:1.0.30001770"
|
resolution: "caniuse-lite@npm:1.0.30001790"
|
||||||
checksum: 10c0/02d15a8b723af65318cb4d888a52bb090076898da7b0de99e8676d537f8d1d2ae4797e81518e1e30cbfe84c33b048c322e8bfafc5b23cfee8defb0d2bf271149
|
checksum: 10c0/eec0adc1dcb35d51e57bcfa0657493cb57ef43f0ceb03c1edcfee34d43e7a938e6beed2781118c7a5ee99d4f71d443977f08ca5a549005cf89260733af9ad3f8
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user