68 lines
1.8 KiB
TypeScript
68 lines
1.8 KiB
TypeScript
import vue from '@vitejs/plugin-vue'
|
|
import { resolve } from 'path'
|
|
import { defineConfig } from 'vite'
|
|
|
|
const lessVariables = resolve(import.meta.dirname, 'src/styles/variables.less').replace(
|
|
/\\/g,
|
|
'/',
|
|
)
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
resolve: {
|
|
alias: {
|
|
"@": resolve(import.meta.dirname, "src"),
|
|
"@c": resolve(import.meta.dirname, "src/components"),
|
|
"/images": "src/assets/images/",
|
|
},
|
|
},
|
|
server: {
|
|
open: true,
|
|
host: '127.0.0.1',
|
|
port: 4402,
|
|
strictPort: true,
|
|
hmr: true,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://127.0.0.1:9000',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
|
}
|
|
}
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
less: {
|
|
javascriptEnabled: true,
|
|
additionalData: `@import "${lessVariables}";`,
|
|
modifyVars: {
|
|
"primary-color": "#1890ff",
|
|
"link-color": " #1890ff",
|
|
"success-color": " #52c41a",
|
|
"warning-color": " #faad14",
|
|
"error-color": " #ff4d4f",
|
|
"font-size-base": " 14px",
|
|
"light-headline": "#262626",
|
|
"light-text": "#595959",
|
|
"light-text-secondary": "#8c8c8c",
|
|
"light-disabled": "#bfbfbf",
|
|
"light-border": " #d9d9d9",
|
|
"light-cut-off-rule": " #f0f0f0",
|
|
"light-bg": " #f5f5f5",
|
|
"light-table-headline": " #fafafa",
|
|
"dark-headline": "#262626",
|
|
"dark-text": "#595959",
|
|
"dark-text-secondary": "#8c8c8c",
|
|
"dark-disabled": "#bfbfbf",
|
|
"dark-border": " #d9d9d9",
|
|
"dark-cut-off-rule": " #f0f0f0",
|
|
"dark-bg": " #f5f5f5",
|
|
"dark-table-headline": " #fafafa",
|
|
"border-radius-base": " 2px",
|
|
"box-shadow-base": " 0 2px 8px rgba(0, 0, 0, 0.15)",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
})
|