eo-services-client/vite.config.js
Peter.Morton 588f90feb6 Added new authentication methods using authKey
and cookies.  Also now handles changes to base url for
use with reverse proxies
2023-07-26 17:01:36 -05:00

80 lines
2.1 KiB
JavaScript

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { createHtmlPlugin } from "vite-plugin-html";
// https://vitejs.dev/config/
export default defineConfig(({ command }) => {
if (command === "serve") {
return {
// dev specific config
plugins: [
vue(),
createHtmlPlugin({
minify: true,
/**
* After writing entry here, you will not need to add script tags in `index.html`, the original tags need to be deleted
* @default src/main.ts
*/
entry: "src/main.js",
/**
* If you want to store `index.html` in the specified folder, you can modify it, otherwise no configuration is required
* @default index.html
*/
template: "index.html",
/**
* Data that needs to be injected into the index.html ejs template
*/
inject: {
data: {
baseHref: '<base href="/"/>',
},
},
}),
],
base: "/",
resolve: {
alias: {
vue: "vue/dist/vue.esm-bundler",
},
},
};
} else {
// command === 'build'
return {
// build specific config
plugins: [
vue(),
createHtmlPlugin({
minify: true,
/**
* After writing entry here, you will not need to add script tags in `index.html`, the original tags need to be deleted
* @default src/main.ts
*/
entry: "src/main.js",
/**
* If you want to store `index.html` in the specified folder, you can modify it, otherwise no configuration is required
* @default index.html
*/
template: "index.html",
/**
* Data that needs to be injected into the index.html ejs template
*/
inject: {
data: {
baseHref: '<base href="/eo-services/"/>',
},
},
}),
],
base: "/eo-services/",
resolve: {
alias: {
vue: "vue/dist/vue.esm-bundler",
},
},
};
}
});