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

48 lines
1.2 KiB
JavaScript
Raw Normal View History

2023-02-15 05:07:17 +00:00
/*
* @Author: Kane
* @Date: 2023-02-15 09:25:52
* @LastEditors: Kane
* @LastEditTime: 2023-03-24 15:47:31
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/
export default defineConfig(( command, mode ) =>
2023-02-28 16:20:47 +00:00
{
const env = loadEnv( mode, process.cwd(), "" );
2023-02-28 16:20:47 +00:00
2023-03-23 10:39:15 +00:00
return {
plugins: [vue(),],
base: "./",
resolve: {
//配置别名
alias: [
{
find: /^~/,
replacement: "",
},
{
find: "@",
replacement: path.resolve( __dirname, "src" ),
2023-03-23 10:39:15 +00:00
},
],
2023-02-28 16:20:47 +00:00
},
2023-03-23 10:39:15 +00:00
define: {
__APP_ENV__: env.APP_ENV,
2023-02-28 16:20:47 +00:00
},
2023-03-23 10:39:15 +00:00
css: {
preprocessorOptions: {
scss: {
additionalData: "@import \"./src/assets/css/public/color.scss\",\"./src/assets/css/public/mixin.scss\";",
2023-03-23 10:39:15 +00:00
},
},
2023-03-04 16:37:24 +00:00
},
2023-03-23 10:39:15 +00:00
};
});