# antv-on-low-version-browser **Repository Path**: cpf23333/antv-on-low-version-browser ## Basic Information - **Project Name**: antv-on-low-version-browser - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-06-06 - **Last Updated**: 2025-06-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 低版本浏览器兼容方案 本案例目的 ``` 以chrome49为最低兼容目标 为chrome49起步的浏览器提供基本的使用体验(存在样式问题) 为chrome90以上的浏览器提供完整使用体验 ``` ## 低版本浏览器兼容步骤 1. 安装 @vitejs/plugin-legacy、terser(装terser是因为@vitejs/plugin-legacy依赖terser,详情见[@vitejs/plugin-legacy的readme](https://www.npmjs.com/package/@vitejs/plugin-legacy)) 2. 项目根目录新增.browserlistrc文件,见本项目根目录的.browserlistrc,内容具体指定浏览器版本多少看各自需求,如何配置见[官网](https://browsersl.ist/) 或自行查询 3. vite.config.ts内添加 ```typescript import legacy from '@vitejs/plugin-legacy' export default defineConfig({ plugins: [legacy({ modernPolyfills: true })], }) ``` 详情见本项目的vite.config.ts 4. App.vue内改动见本项目App.vue 5. 完毕,可以打包了 # antv-on-low-version-browser This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vite.dev/config/). ## Project Setup ```sh pnpm install ``` ### Compile and Hot-Reload for Development ```sh pnpm dev ``` ### Type-Check, Compile and Minify for Production ```sh pnpm build ``` ### Run Unit Tests with [Vitest](https://vitest.dev/) ```sh pnpm test:unit ``` ### Lint with [ESLint](https://eslint.org/) ```sh pnpm lint ```