desktop_task_schedule/code/web/task_schedule/vite.config.js

48 lines
980 B
JavaScript
Raw Normal View History

2023-02-15 05:07:17 +00:00
/*
* @Author: Kane
* @Date: 2023-02-15 09:25:52
* @LastEditors: Kane
2023-03-03 08:08:27 +00:00
* @LastEditTime: 2023-03-03 15:52:58
2023-02-15 05:07:17 +00:00
* @FilePath: /task_schedule/vite.config.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
2023-03-04 16:37:24 +00:00
import { defineConfig, loadEnv } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";
2023-02-15 05:07:17 +00:00
// https://vitejs.dev/config/
2023-02-28 16:20:47 +00:00
export default defineConfig((command, mode) =>
{
2023-03-04 16:37:24 +00:00
const env = loadEnv(mode, process.cwd(), "");
2023-02-28 16:20:47 +00:00
return {
plugins: [vue(),],
2023-03-04 16:37:24 +00:00
base: "./",
2023-02-28 16:20:47 +00:00
resolve: {
//配置别名
alias: [
{
find: /^~/,
2023-03-04 16:37:24 +00:00
replacement: "",
2023-02-28 16:20:47 +00:00
},
{
2023-03-04 16:37:24 +00:00
find: "@",
replacement: path.resolve(__dirname, "src"),
2023-02-28 16:20:47 +00:00
},
],
},
define: {
__APP_ENV__: env.APP_ENV,
},
2023-03-03 08:08:27 +00:00
css: {
preprocessorOptions: {
scss: {
2023-03-04 16:37:24 +00:00
additionalData: "@import \"./src/assets/css/public/color.scss\";",
},
},
},
2023-02-28 16:20:47 +00:00
};
});