mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-08 20:09:19 +00:00
review: use real path
This commit is contained in:
@@ -337,7 +337,7 @@ export function getRelativeRoomUrl(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perfom a network operation with retries on ConnectionError.
|
* Perform a network operation with retries on ConnectionError.
|
||||||
* If the error is not retryable, or the max number of retries is reached, the error is rethrown.
|
* If the error is not retryable, or the max number of retries is reached, the error is rethrown.
|
||||||
* Supports handling of matrix quotas.
|
* Supports handling of matrix quotas.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -12,9 +12,10 @@ import { codecovVitePlugin } from "@codecov/vite-plugin";
|
|||||||
import { sentryVitePlugin } from "@sentry/vite-plugin";
|
import { sentryVitePlugin } from "@sentry/vite-plugin";
|
||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
import basicSsl from "@vitejs/plugin-basic-ssl";
|
import basicSsl from "@vitejs/plugin-basic-ssl";
|
||||||
|
import { realpath } from "fs/promises";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig(({ mode, packageType }) => {
|
export default defineConfig(async ({ mode, packageType }) => {
|
||||||
const env = loadEnv(mode, process.cwd());
|
const env = loadEnv(mode, process.cwd());
|
||||||
// Environment variables with the VITE_ prefix are accessible at runtime.
|
// Environment variables with the VITE_ prefix are accessible at runtime.
|
||||||
// So, we set this to allow for build/package specific behaviour.
|
// So, we set this to allow for build/package specific behaviour.
|
||||||
@@ -63,18 +64,18 @@ export default defineConfig(({ mode, packageType }) => {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
const allow = [searchForWorkspaceRoot(process.cwd())];
|
||||||
|
const matrixSdkCryptoWasmPath =
|
||||||
|
"node_modules/matrix-js-sdk/node_modules/@matrix-org/matrix-sdk-crypto-wasm";
|
||||||
|
await realpath(matrixSdkCryptoWasmPath)
|
||||||
|
.then((p) => allow.push(p))
|
||||||
|
.catch(() => {});
|
||||||
|
console.log("Allowed vite paths:", allow);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
server: {
|
server: {
|
||||||
port: 3000,
|
port: 3000,
|
||||||
fs: {
|
fs: { allow },
|
||||||
allow: [
|
|
||||||
// search up for workspace root
|
|
||||||
searchForWorkspaceRoot(process.cwd()),
|
|
||||||
// Allow fs access to local build of wasm
|
|
||||||
"../matrix-rust-sdk-crypto-wasm/pkg",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user