Skip to content

Commit

Permalink
Merge pull request #63 from DiamondLightSource/fix-vite-issues
Browse files Browse the repository at this point in the history
Fix vite issues
  • Loading branch information
abigailalexander authored Sep 25, 2024
2 parents 4a00374 + f414aee commit 79d8ad4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.3.0",
"description": "Control system web library",
"main": "dist/cjs/index.js",
"type": "module",
"scripts": {
"rollup": "rollup -c",
"test": "vitest",
Expand Down
4 changes: 3 additions & 1 deletion src/misc/profilerCallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import log from "loglevel";
* and for more reliable measurements
*/

const PROFILE_ENABLED = import.meta.env.VITE_PROFILER_ENABLED === "true";
const PROFILE_ENABLED =
(process.env.VITE_PROFILER_ENABLED ??
import.meta.env.VITE_PROFILER_ENABLED) === "true";
const ITEMS_TO_STORE = 100;

class Timings {
Expand Down
10 changes: 7 additions & 3 deletions src/redux/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ import { SimulatorPlugin } from "../connection/sim";
import { ConiqlPlugin } from "../connection/coniql";
import { ConnectionForwarder } from "../connection/forwarder";

const CONIQL_SOCKET = import.meta.env.VITE_CONIQL_SOCKET;
const CONIQL_SSL = import.meta.env.VITE_CONIQL_SSL === "true";
const CONIQL_SOCKET =
process.env.VITE_CONIQL_SOCKET ?? import.meta.env.VITE_CONIQL_SOCKET;
const CONIQL_SSL =
(process.env.VITE_CONIQL_SSL ?? import.meta.env.VITE_CONIQL_SSL) === "true";
const THROTTLE_PERIOD = parseFloat(
import.meta.env.VITE_THROTTLE_PERIOD ?? "100"
process.env.VITE_THROTTLE_PERIOD ??
import.meta.env.VITE_THROTTLE_PERIOD ??
"100"
);

const simulator = new SimulatorPlugin();
Expand Down
7 changes: 5 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@
"noFallthroughCasesInSwitch": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
"noEmit": true,
"types": [
"vite/client"
],
},
"include": [
"src"
]
}
}

0 comments on commit 79d8ad4

Please sign in to comment.