fix: 优化浏览器兼容策略
This commit is contained in:
@@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
"plugins": [
|
|
||||||
[
|
|
||||||
"@babel/plugin-transform-runtime",
|
|
||||||
{
|
|
||||||
"corejs": 3
|
|
||||||
}
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"presets": [
|
|
||||||
[
|
|
||||||
"@babel/preset-env",
|
|
||||||
{
|
|
||||||
"targets": {
|
|
||||||
"ie": "11",
|
|
||||||
"chrome": "58",
|
|
||||||
"safari": "11.1",
|
|
||||||
"firefox": "63",
|
|
||||||
"edge": "16"
|
|
||||||
},
|
|
||||||
"corejs": 3,
|
|
||||||
"useBuiltIns": "usage",
|
|
||||||
"modules": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
@@ -6,8 +6,6 @@ import routeConfig from './router'
|
|||||||
import 'virtual:svg-icons-register'
|
import 'virtual:svg-icons-register'
|
||||||
import { Provider as MobxProvider } from 'mobx-react'
|
import { Provider as MobxProvider } from 'mobx-react'
|
||||||
import { RootStore } from '@/store'
|
import { RootStore } from '@/store'
|
||||||
import 'core-js';
|
|
||||||
import 'regenerator-runtime/runtime';
|
|
||||||
const router = createBrowserRouter(routeConfig)
|
const router = createBrowserRouter(routeConfig)
|
||||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||||
// <React.StrictMode>
|
// <React.StrictMode>
|
||||||
|
@@ -20,7 +20,16 @@ export default defineConfig(({mode}) => {
|
|||||||
plugins: [
|
plugins: [
|
||||||
react(),
|
react(),
|
||||||
legacy({
|
legacy({
|
||||||
targets: ['ie >= 11', 'chrome 52', 'Chrome > 70', 'Safari 12.1', 'last 2 versions and since 2018 and > 0.5%', 'iOS >= 9','Android >= 4.4','last 2 versions'],
|
targets: [
|
||||||
|
'ie >= 11',
|
||||||
|
'chrome 52',
|
||||||
|
'Chrome > 70',
|
||||||
|
'Safari 12.1',
|
||||||
|
'last 2 versions and since 2018 and > 0.5%',
|
||||||
|
'iOS >= 9',
|
||||||
|
'Android >= 4.4',
|
||||||
|
'last 2 versions',
|
||||||
|
],
|
||||||
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
|
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
|
||||||
renderLegacyChunks: true,
|
renderLegacyChunks: true,
|
||||||
polyfills: [
|
polyfills: [
|
||||||
@@ -40,9 +49,13 @@ export default defineConfig(({mode}) => {
|
|||||||
'es.object.to-string',
|
'es.object.to-string',
|
||||||
'web.dom-collections.for-each',
|
'web.dom-collections.for-each',
|
||||||
'esnext.global-this',
|
'esnext.global-this',
|
||||||
'esnext.string.match-all'
|
'esnext.string.match-all',
|
||||||
|
],
|
||||||
|
modernPolyfills: [
|
||||||
|
'es.promise.all-settled',
|
||||||
|
'es.object.entries',
|
||||||
|
'es.string.replace-all',
|
||||||
],
|
],
|
||||||
modernPolyfills: ['es.promise.all-settled', 'es.object.entries', 'es.string.replace-all'],
|
|
||||||
}),
|
}),
|
||||||
// 修改 icons 相关配置
|
// 修改 icons 相关配置
|
||||||
createSvgIconsPlugin({
|
createSvgIconsPlugin({
|
||||||
|
Reference in New Issue
Block a user