Initial project
This commit is contained in:
91
vite.config.ts
Normal file
91
vite.config.ts
Normal file
@ -0,0 +1,91 @@
|
||||
import { defineConfig } from "vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import dts from "vite-plugin-dts";
|
||||
import { resolve } from "path";
|
||||
import VueSetupExtend from "vite-plugin-vue-setup-extend";
|
||||
import AutoImport from "unplugin-auto-import/vite";
|
||||
import Components from "unplugin-vue-components/vite";
|
||||
import { TDesignResolver } from "unplugin-vue-components/resolvers";
|
||||
|
||||
export default defineConfig({
|
||||
base: "/",
|
||||
plugins: [
|
||||
vue(),
|
||||
dts({
|
||||
include: "./src"
|
||||
}),
|
||||
VueSetupExtend(),
|
||||
AutoImport({
|
||||
imports: [
|
||||
"vue",
|
||||
"vue-router",
|
||||
"pinia",
|
||||
{
|
||||
"axios": [
|
||||
["default", "axios"]
|
||||
]
|
||||
}
|
||||
],
|
||||
dts: "src/auto-imports.d.ts",
|
||||
eslintrc: {
|
||||
enabled: true,
|
||||
globalsPropValue: true
|
||||
},
|
||||
resolvers: [
|
||||
TDesignResolver({
|
||||
library: "vue-next"
|
||||
})
|
||||
]
|
||||
}),
|
||||
Components({
|
||||
dirs: [
|
||||
"src/components",
|
||||
"src/layout",
|
||||
"src/views/components"
|
||||
],
|
||||
resolvers: [
|
||||
TDesignResolver({
|
||||
library: "vue-next"
|
||||
})
|
||||
]
|
||||
})
|
||||
],
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
less: {
|
||||
math: "always",
|
||||
lessOptions: {
|
||||
modifyVars: {
|
||||
"@btn-border-radius": "0"
|
||||
},
|
||||
javascriptEnabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
define: {
|
||||
"process.env": {}
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": resolve(__dirname, "src")
|
||||
},
|
||||
extensions: [".js", ".json", ".ts"]
|
||||
},
|
||||
server: {
|
||||
port: 80,
|
||||
host: "imyeyu.dev"
|
||||
},
|
||||
build: {
|
||||
sourcemap: false,
|
||||
minify: "terser",
|
||||
terserOptions: {
|
||||
compress: {
|
||||
// eslint-disable-next-line camelcase
|
||||
drop_console: true,
|
||||
// eslint-disable-next-line camelcase
|
||||
drop_debugger: true
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user