|
|
3 gadi atpakaļ | |
|---|---|---|
| .vscode | 3 gadi atpakaļ | |
| src | 3 gadi atpakaļ | |
| .env.development | 3 gadi atpakaļ | |
| .env.production | 3 gadi atpakaļ | |
| .eslintrc.js | 3 gadi atpakaļ | |
| .gitignore | 3 gadi atpakaļ | |
| README.md | 3 gadi atpakaļ | |
| components.d.ts | 3 gadi atpakaļ | |
| index.html | 3 gadi atpakaļ | |
| package-lock.json | 3 gadi atpakaļ | |
| package.json | 3 gadi atpakaļ | |
| prettier.config.js | 3 gadi atpakaļ | |
| tsconfig.json | 3 gadi atpakaļ | |
| tsconfig.node.json | 3 gadi atpakaļ | |
| vite.config.ts | 3 gadi atpakaļ | |
| yarn.lock | 3 gadi atpakaļ |
https://blog.csdn.net/weixin_43299180/article/details/112007458
`if (location.href.indexOf("#reloaded") === -1) {
location.href = location.href + "#reloaded";
location.reload();
}`
yarn add @vitejs/plugin-legacy
import legacy from '@vitejs/plugin-legacy'
plugins:[
legacy({
targets: ['chrome 50', 'ie >= 11'], //兼容最低版本号50(UC浏览器55)
additionalLegacyPolyfills: ['regenerator-runtime/runtime'], // regenerator-runtime/runtime @dian/polyfill
renderLegacyChunks: true,
polyfills: [
'es.symbol',
'es.array.filter',
'es.promise',
'es.promise.finally',
'es/map',
'es/set',
'es.array.for-each',
'es.object.define-properties',
'es.object.define-property',
'es.object.get-own-property-descriptor',
'es.object.get-own-property-descriptors',
'es.object.keys',
'es.object.to-string',
'web.dom-collections.for-each',
'esnext.global-this',
'esnext.string.match-all',
// // 这个无法处理
// 'es.string.replace-all'
],
modernPolyfills: ['es.string.replace-all']
})
]
terser not found. Since Vite v3, terser has become an optional dependency. You need to install it.
yarn add terser --legacy-peer-deps 再重新打包