WASAPhoto/webui/vite.config.js

31 lines
684 B
JavaScript
Raw Permalink Normal View History

2022-11-24 14:46:29 +01:00
import {fileURLToPath, URL} from 'node:url'
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig(({command, mode, ssrBuild}) => {
const ret = {
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
};
if (command === 'serve' && mode !== 'developement-external') {
2022-11-24 14:46:29 +01:00
ret.define = {
"__API_URL__": JSON.stringify("http://localhost:3000"),
};
2022-12-23 01:17:03 +01:00
} else if (mode === 'embedded') {
ret.define = {
"__API_URL__": JSON.stringify("/"),
};
2022-11-24 14:46:29 +01:00
} else {
ret.define = {
"__API_URL__": JSON.stringify("<your API URL>"),
2022-11-24 14:46:29 +01:00
};
}
return ret;
})