Commit 7410df5f by haojie[

修改部分包引入方式

parent a54bd7bd
# Vue 3 + TypeScript + Vite
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
## Recommended IDE Setup
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
## 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 [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
1. Disable the built-in TypeScript Extension
1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -12,8 +12,6 @@
"preview": "vite preview"
},
"dependencies": {
"@vitejs/plugin-legacy": "^3.0.1",
"@vitejs/plugin-vue-jsx": "^3.0.0",
"dayjs": "^1.11.7",
"event-source-polyfill": "^1.0.31",
"js-cookie": "^3.0.1",
......@@ -30,7 +28,9 @@
"@types/js-cookie": "^3.0.2",
"@types/node": "^18.11.15",
"@types/uuid": "^9.0.0",
"@vitejs/plugin-legacy": "^4.0.2",
"@vitejs/plugin-vue": "^4.0.0",
"@vitejs/plugin-vue-jsx": "^3.0.1",
"axios": "^0.24.0",
"express": "^4.18.2",
"http-proxy-middleware": "^2.0.6",
......
......@@ -65,7 +65,7 @@ export default defineConfig(({ command, mode }) => {
rollupOptions: {
output: {
manualChunks: {
// 拆分代码,这个就是分包,配置完后自动按需加载,现在还比不上webpack的splitchunk,不过也能用了。
// 拆分代码,这个就是分包,配置完后自动按需加载
vue: ['vue', 'vue-router', 'vuex'],
},
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment