minecraft-color-gradient-ge.../vite.config.ts

45 lines
1.3 KiB
TypeScript
Raw Normal View History

2023-12-18 12:36:32 +08:00
import { fileURLToPath, URL } from "node:url";
2023-06-29 18:24:53 +08:00
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
2023-12-18 12:36:32 +08:00
import version from "vite-plugin-package-version";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { TDesignResolver } from "unplugin-vue-components/resolvers";
2023-06-29 17:42:54 +08:00
// https://vitejs.dev/config/
export default defineConfig({
2023-12-18 12:36:32 +08:00
plugins: [
vue(),
version(),
AutoImport({ resolvers: [TDesignResolver({ library: "vue-next" })] }),
Components({ resolvers: [TDesignResolver({ library: "vue-next" })] }),
],
resolve: {
alias: [{ find: "@", replacement: fileURLToPath(new URL("./src", import.meta.url)) }],
},
build: {
rollupOptions: {
output: {
entryFileNames: `static/entry/[name]-[hash].js`,
chunkFileNames: `static/chunk/[name]-[hash].js`,
assetFileNames: `static/file/[name]-[hash].[ext]`,
manualChunks: {
vue: ["vue"],
lodash: ["lodash-es"],
vuedraggable: ["vuedraggable-es"],
tdesign: ["tdesign-vue-next"],
},
},
},
},
2023-12-18 12:36:32 +08:00
css: {
preprocessorOptions: {
scss: {
additionalData: `
@import "@/styles/mixins.scss";
`,
},
},
},
2023-06-29 18:24:53 +08:00
});