vue3.0 vite 处理打包到ios11上面白屏问题
vue3.0vite 处理打包到ios11上面白屏问题
·
vite.config.js
import legacy from "@vitejs/plugin-legacy";
const plugins = [
vue(),
legacy({
targets: [
"> 1%, last 1 version, ie >= 11",
"safari >= 10",
"Android > 39",
"Chrome >= 60",
"Safari >= 10.1",
"iOS >= 10.3",
"Firefox >= 54",
"Edge >= 15"
],
additionalLegacyPolyfills: ["regenerator-runtime/runtime"],
polyfills: ["es.promise.finally", "es/map", "es/set"],
modernPolyfills: ["es.promise.finally"]
})
];
export default defineConfig({
server: {
fs: {
strict: false
}
},
plugins,
resolve: {
alias: {
"@": resolve("./src")
}
},
build: {
outDir: 'dist',
target: ['es2015'], // 这一段必填
rollupOptions: {
external:['axios'],
input: pageEntry,
output: {
manualChunks(id) {
if (id.includes("node_modules")) {
return id
.toString()
.split("node_modules/")[1]
.split("/")[0]
.toString();
}
}
}
}
}
});
更多推荐
已为社区贡献3条内容
所有评论(0)