Skip to content

Commit 4d48af8

Browse files
committed
feat: add plugin-legacy, as the main use case for v2 is for IE11 support
1 parent 76aeeba commit 4d48af8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

template/base/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
"vue": "^2.6.14"
1010
},
1111
"devDependencies": {
12+
"@vitejs/plugin-legacy": "^1.6.3",
1213
"@vue/runtime-dom": "^3.2.22",
1314
"unplugin-vue2-script-setup": "^0.7.1",
14-
"vite-plugin-vue2": "^1.9.0",
1515
"vite": "^2.6.14",
16+
"vite-plugin-vue2": "^1.9.0",
1617
"vue-template-compiler": "^2.6.14"
1718
}
1819
}

template/base/vite.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { fileURLToPath } from 'url'
22

33
import { defineConfig } from 'vite'
4+
import legacy from '@vitejs/plugin-legacy'
45
import { createVuePlugin as vue2 } from 'vite-plugin-vue2'
56
import scriptSetup from 'unplugin-vue2-script-setup/vite'
67

@@ -10,7 +11,11 @@ export default defineConfig({
1011
vue2({
1112
jsx: true
1213
}),
13-
scriptSetup()
14+
scriptSetup(),
15+
legacy({
16+
targets: ['ie >= 11'],
17+
additionalLegacyPolyfills: ['regenerator-runtime/runtime']
18+
})
1419
],
1520
resolve: {
1621
alias: {

0 commit comments

Comments
 (0)