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

49 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
2023-06-25 10:29:36 +00:00
* @LastEditTime: 2023-06-25 09:51:13
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 {
2023-06-25 10:29:36 +00:00
server:{ host: "localhost", port: 5173, },
2023-03-23 10:39:15 +00:00
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: {
2023-03-31 11:53:12 +00:00
additionalData: "@import \"./src/assets/css/public/variables.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
};
});