Commit 85036f0f authored by Taylor Hanayik's avatar Taylor Hanayik
Browse files

update dev preview to use fsl-gui-core

parent 0fd72cdc
......@@ -15,6 +15,7 @@
"@mui/lab": "^5.0.0-alpha.70",
"@mui/material": "^5.2.4",
"@niivue/niivue": "^0.22.2",
"dotenv": "^16.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"socket.io-client": "^4.4.0"
......@@ -1398,6 +1399,14 @@
"csstype": "^3.0.2"
}
},
"node_modules/dotenv": {
"version": "16.0.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz",
"integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==",
"engines": {
"node": ">=12"
}
},
"node_modules/electron-to-chromium": {
"version": "1.4.23",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.23.tgz",
......@@ -3283,6 +3292,11 @@
"csstype": "^3.0.2"
}
},
"dotenv": {
"version": "16.0.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz",
"integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q=="
},
"electron-to-chromium": {
"version": "1.4.23",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.23.tgz",
......
......@@ -2,7 +2,7 @@
"name": "fsl-gui-bet",
"version": "0.0.0",
"scripts": {
"dev": "vite",
"dev": "cd ../fsl-gui-core && npm run start & sleep 3 && vite",
"build": "vite build && npm run devinstall",
"preview": "vite preview",
"devinstall": "mkdir -p $HOME/.fslgui/bet && cp -r dist/* $HOME/.fslgui/bet/"
......@@ -15,6 +15,7 @@
"@mui/lab": "^5.0.0-alpha.70",
"@mui/material": "^5.2.4",
"@niivue/niivue": "^0.22.2",
"dotenv": "^16.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"socket.io-client": "^4.4.0"
......
......@@ -9,9 +9,9 @@ import "./App.css"
// get web socket connection info from url before rendering anything
let urlParams = new URLSearchParams(window.location.search)
let host = urlParams.get('host')
let socketServerPort = urlParams.get('socketServerPort')
let fileServerPort = urlParams.get('fileServerPort')
let host = urlParams.get('host') || import.meta.env.VITE_FSLGUI_HOST
let socketServerPort = urlParams.get('socketServerPort') || import.meta.env.VITE_FSLGUI_WS_PORT
let fileServerPort = urlParams.get('fileServerPort') || import.meta.env.VITE_FSLGUI_FS_PORT
let useShortDisplay = urlParams.get('shortNames') // can be set from global FSL settings on user's machine
console.log(host, socketServerPort, fileServerPort)
......
import { defineConfig } from 'vite'
import { defineConfig, loadEnv} from 'vite'
import react from '@vitejs/plugin-react'
require('dotenv').config({path: '~/.fslgui.env'})
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
base: './'
base: './',
root: '.',
server: {
open: 'index.html',
fs: {
// Allow serving files from one level up to the project root
allow: ['..']
}
},
})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment