mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-20 05:46:34 +00:00
[P_UI] Added django settings for p_ui (#5343)
* Added django settings for pui * Fix: server version is not loaded on initial load * Moved server version out of server selector icon * Use polling only for WSL * Added comment and extracted to constant instead of function * Default show server selector to false if not in dev mode * Refactored hostList settings * Move json serialization into global scope * Show server selector in netlify builds * Use demo server for netlify * Renamed netilfy mode to dev or demo mode * Translate for netlify * Dont use translation in main as the are not working there
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { platform } from 'node:os';
|
||||
import { defineConfig, splitVendorChunkPlugin } from 'vite';
|
||||
|
||||
const IS_IN_WSL = platform().includes('WSL');
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
@ -16,8 +19,17 @@ export default defineConfig({
|
||||
outDir: '../../InvenTree/web/static/web'
|
||||
},
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:8000',
|
||||
changeOrigin: true,
|
||||
secure: true
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
usePolling: true
|
||||
// use polling only for WSL as the file system doesn't trigger notifications for Linux apps
|
||||
// ref: https://github.com/vitejs/vite/issues/1153#issuecomment-785467271
|
||||
usePolling: IS_IN_WSL
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user