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

48 lines
980 B
JavaScript

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