mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-29 21:15:19 +00:00
Use .ts files for vite config for type safety
This commit is contained in:
@@ -1,4 +1,13 @@
|
|||||||
export default {
|
/*
|
||||||
|
Copyright 2024 New Vector Ltd.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
Please see LICENSE in the repository root for full details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import type { UserConfig } from "i18next-parser";
|
||||||
|
|
||||||
|
const config: UserConfig = {
|
||||||
keySeparator: ".",
|
keySeparator: ".",
|
||||||
namespaceSeparator: false,
|
namespaceSeparator: false,
|
||||||
contextSeparator: "|",
|
contextSeparator: "|",
|
||||||
@@ -26,3 +35,5 @@ export default {
|
|||||||
input: ["src/**/*.{ts,tsx}"],
|
input: ["src/**/*.{ts,tsx}"],
|
||||||
sort: true,
|
sort: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
// Workaround for https://github.com/microsoft/TypeScript/issues/55132
|
// Workaround for https://github.com/microsoft/TypeScript/issues/55132
|
||||||
"useDefineForClassFields": false,
|
"useDefineForClassFields": false,
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
// These imports within @livekit/components-core and
|
// These imports within @livekit/components-core and
|
||||||
// @livekit/components-react are broken under the "bundler" module
|
// @livekit/components-react are broken under the "bundler" module
|
||||||
@@ -50,6 +51,7 @@
|
|||||||
"include": [
|
"include": [
|
||||||
"./node_modules/matrix-js-sdk/src/@types/*.d.ts",
|
"./node_modules/matrix-js-sdk/src/@types/*.d.ts",
|
||||||
"./src/**/*.ts",
|
"./src/**/*.ts",
|
||||||
"./src/**/*.tsx"
|
"./src/**/*.tsx",
|
||||||
|
"*.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ export default defineConfig(({ mode }) => {
|
|||||||
ref: true,
|
ref: true,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
htmlTemplate.default({
|
// types workaround for https://github.com/IndexXuan/vite-plugin-html-template/issues/37
|
||||||
|
(htmlTemplate as unknown as { default: typeof htmlTemplate }).default({
|
||||||
data: {
|
data: {
|
||||||
title: env.VITE_PRODUCT_NAME || "Element Call",
|
title: env.VITE_PRODUCT_NAME || "Element Call",
|
||||||
},
|
},
|
||||||
@@ -53,8 +54,10 @@ export default defineConfig(({ mode }) => {
|
|||||||
) {
|
) {
|
||||||
plugins.push(
|
plugins.push(
|
||||||
sentryVitePlugin({
|
sentryVitePlugin({
|
||||||
include: "./dist",
|
release: {
|
||||||
release: process.env.VITE_APP_VERSION,
|
dist: process.env.VITE_APP_VERSION,
|
||||||
|
name: process.env.VITE_APP_VERSION,
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -67,7 +70,7 @@ export default defineConfig(({ mode }) => {
|
|||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
output: {
|
output: {
|
||||||
assetFileNames: ({ originalFileNames }) => {
|
assetFileNames: ({ originalFileNames }): string => {
|
||||||
if (originalFileNames) {
|
if (originalFileNames) {
|
||||||
for (const name of originalFileNames) {
|
for (const name of originalFileNames) {
|
||||||
// Custom asset name for locales to include the locale code in the filename
|
// Custom asset name for locales to include the locale code in the filename
|
||||||
@@ -1,5 +1,13 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2024 New Vector Ltd.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
Please see LICENSE in the repository root for full details.
|
||||||
|
*/
|
||||||
|
|
||||||
import { defineConfig, mergeConfig } from "vitest/config";
|
import { defineConfig, mergeConfig } from "vitest/config";
|
||||||
import viteConfig from "./vite.config.js";
|
|
||||||
|
import viteConfig from "./vite.config";
|
||||||
|
|
||||||
export default defineConfig((configEnv) =>
|
export default defineConfig((configEnv) =>
|
||||||
mergeConfig(
|
mergeConfig(
|
||||||
Reference in New Issue
Block a user