Skip to content

Commit

Permalink
Chore: update mockServer
Browse files Browse the repository at this point in the history
  • Loading branch information
CharleeWa committed Jun 6, 2022
1 parent 27721c6 commit b6fcaa0
Show file tree
Hide file tree
Showing 5 changed files with 1,633 additions and 1,498 deletions.
2 changes: 1 addition & 1 deletion build/mockServer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createMockMiddleware } from 'umi-mock-middleware'
import { createMockMiddleware } from 'umi-mock-middleware2'
import express from 'express'
const createMockServer = () => {
const mockTarget = `http://127.0.0.1:${process.env.MOCK_SERVER_PORT}`
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,16 @@
"@types/nprogress": "^0.2.0",
"@types/store": "^2.0.2",
"@vitejs/plugin-vue": "^2.3.3",
"chokidar": "^3.5.3",
"consola": "^2.15.3",
"cross-env": "^7.0.3",
"express": "4.17.3",
"glob": "^8.0.3",
"less": "^4.1.2",
"mockjs": "^1.1.0",
"postcss-px-to-viewport": "^1.1.1",
"typescript": "^4.5.4",
"umi-mock-middleware": "^1.0.0",
"umi-mock-middleware2": "^1.0.2",
"vite": "^2.9.9",
"vite-plugin-style-import": "1.4.1",
"vite-plugin-style-import": "^2.0.0",
"vue-tsc": "^0.34.7"
}
}
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"types": [],
"paths": {
"@/*": ["src/*"]
},
Expand All @@ -26,6 +27,8 @@
"src/App.vue",
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue"
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx"
]
}
13 changes: 10 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ConfigEnv, UserConfig } from 'vite'
import { loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import styleImport, { VantResolve } from 'vite-plugin-style-import'
import { createStyleImportPlugin } from 'vite-plugin-style-import'
import createMockServer from './build/mockServer'

// https://vitejs.dev/config/
Expand All @@ -17,8 +17,15 @@ export default ({ mode }: ConfigEnv): UserConfig => {
},
plugins: [
vue(),
styleImport({
resolves: [VantResolve()]
createStyleImportPlugin({
resolves:[],
libs: [{
libraryName: 'vant',
esModule: false,
resolveStyle: (name) => {
return `vant/es/${name}/style/less`
}
}]
})
],
resolve: {
Expand Down
Loading

0 comments on commit b6fcaa0

Please sign in to comment.