Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

chore: config setup for asset migration, allow use of @ alias (#10901)

SagarRajput-75251339a1672
diff --git a/frontend/__mocks__/fileMock.ts b/frontend/__mocks__/fileMock.ts
new file mode 100644
index 0000000000..602eb23ee2
--- /dev/null
+++ b/frontend/__mocks__/fileMock.ts
@@ -0,0 +1 @@
+export default 'test-file-stub';
diff --git a/frontend/jest.config.ts b/frontend/jest.config.ts
index 28a4468156..6082d826b9 100644
--- a/frontend/jest.config.ts
+++ b/frontend/jest.config.ts
@@ -11,6 +11,9 @@ const config: Config.InitialOptions = {
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
modulePathIgnorePatterns: ['dist'],
moduleNameMapper: {
+ '\\.(png|jpg|jpeg|gif|svg|webp|avif|ico|bmp|tiff)$':
+ '<rootDir>/__mocks__/fileMock.ts',
+ '^@/(.*)$': '<rootDir>/src/$1',
'\\.(css|less|scss)$': '<rootDir>/__mocks__/cssMock.ts',
'\\.md$': '<rootDir>/__mocks__/cssMock.ts',
'^uplot$': '<rootDir>/__mocks__/uplotMock.ts',
diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json
index c029a07ff2..5776b9cbcc 100644
--- a/frontend/tsconfig.json
+++ b/frontend/tsconfig.json
@@ -12,7 +12,11 @@
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
- "lib": ["dom", "dom.iterable", "esnext"],
+ "lib": [
+ "dom",
+ "dom.iterable",
+ "esnext"
+ ],
"allowSyntheticDefaultImports": true,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "bundler",
@@ -21,8 +25,15 @@
"noEmit": true,
"baseUrl": "./src",
"paths": {
- "*": ["./*"],
- "@constants/*": ["./container/OnboardingContainer/constants/*"]
+ "*": [
+ "./*"
+ ],
+ "@constants/*": [
+ "./container/OnboardingContainer/constants/*"
+ ],
+ "@/*": [
+ "./*"
+ ]
},
"downlevelIteration": true,
"plugins": [
@@ -30,9 +41,18 @@
"name": "typescript-plugin-css-modules"
}
],
- "types": ["vite/client", "node", "jest"]
+ "types": [
+ "vite/client",
+ "node",
+ "jest"
+ ]
},
- "exclude": ["node_modules", "src/parser/*.ts", "src/parser/TraceOperatorParser/*.ts", "orval.config.ts"],
+ "exclude": [
+ "node_modules",
+ "src/parser/*.ts",
+ "src/parser/TraceOperatorParser/*.ts",
+ "orval.config.ts"
+ ],
"include": [
"./src",
"./src/**/*.ts",
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
index d5ebce58e6..5c7d3aac0f 100644
--- a/frontend/vite.config.ts
+++ b/frontend/vite.config.ts
@@ -83,6 +83,7 @@ export default defineConfig(
plugins,
resolve: {
alias: {
+ '@': resolve(__dirname, './src'),
utils: resolve(__dirname, './src/utils'),
types: resolve(__dirname, './src/types'),
constants: resolve(__dirname, './src/constants'),