| | |
| | | import IconsResolver from 'unplugin-icons/resolver' |
| | | import Icons from 'unplugin-icons/vite' |
| | | import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' |
| | | |
| | | // 兼容低版本浏览器 |
| | | import legacy from '@vitejs/plugin-legacy' |
| | | const pathSrc = path.resolve(__dirname, 'src') |
| | | |
| | | // https://vitejs.dev/config/ |
| | |
| | | resolve: { |
| | | alias: { |
| | | '@': pathSrc |
| | | } |
| | | }, |
| | | }, |
| | | |
| | | build: { |
| | | target:['chrome52'], |
| | | cssTarget:["chrome52"], |
| | | }, |
| | | plugins: [ |
| | | vue(), |
| | |
| | | |
| | | dts: path.resolve(pathSrc, 'auto-imports.d.ts') |
| | | }), |
| | | |
| | | // 兼容低版本浏览器 |
| | | legacy({ |
| | | targets: ['defaults', 'ie >= 11', 'chrome < 60','firefox < 59'], //需要兼容的目标列表,可以设置多个 |
| | | additionalLegacyPolyfills: ['regenerator-runtime/runtime'], |
| | | renderLegacyChunks: true, |
| | | modernPolyfills: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' |
| | | ] |
| | | }), |
| | | Components({ |
| | | resolvers: [ |
| | | // 自动注册图标组件 |
| | |
| | | }), |
| | | Icons({ |
| | | autoInstall: true |
| | | }) |
| | | ] |
| | | }), |
| | | ], |
| | | configureWebpack:config=>{ |
| | | config.entry.app=['babel-polyfill','./src/main.js'] |
| | | }, |
| | | // chainWebpack: (config) => { |
| | | // config.entry('main').add('babel-polyfill') |
| | | // }, |
| | | }) |