From dd0a9eb8f5a1856a9ad3f91ba44d79e18a6c111f Mon Sep 17 00:00:00 2001 From: Mirjam Aulbach Date: Wed, 26 Oct 2022 13:55:17 +0200 Subject: [PATCH] Change alias to src. --- coral/jest.config.ts | 4 ++-- coral/src/App.test.tsx | 2 +- coral/src/main.tsx | 2 +- coral/tsconfig.json | 3 --- coral/vite.config.ts | 5 +---- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/coral/jest.config.ts b/coral/jest.config.ts index 26bbba659d..ee0ed304fa 100644 --- a/coral/jest.config.ts +++ b/coral/jest.config.ts @@ -7,10 +7,10 @@ export default { moduleFileExtensions: ["js", "jsx", "ts", "tsx"], preset: "ts-jest", testEnvironment: "jsdom", - setupFilesAfterEnv: ['/test-setup/setup-files-after-env.ts'], + setupFilesAfterEnv: ["/test-setup/setup-files-after-env.ts"], moduleNameMapper: { ".+\\.(png|jpg|ttf|woff|woff2|svg)$": "jest-transform-stub", "\\.css$": "identity-obj-proxy", - "^@/(.*)$": "/src/$1", + "^src/(.*)$": "/src/$1", }, }; diff --git a/coral/src/App.test.tsx b/coral/src/App.test.tsx index 7608654a73..67f9f188c1 100644 --- a/coral/src/App.test.tsx +++ b/coral/src/App.test.tsx @@ -1,5 +1,5 @@ -import App from "@/App"; import { render, screen } from "@testing-library/react"; +import App from "src/App"; describe("App.tsx", () => { it("shows a headline", () => { diff --git a/coral/src/main.tsx b/coral/src/main.tsx index 82d85e470c..207ff91236 100644 --- a/coral/src/main.tsx +++ b/coral/src/main.tsx @@ -1,7 +1,7 @@ import React from "react"; import ReactDOM from "react-dom/client"; import "@aivenio/design-system/dist/styles.css"; -import App from "@/App"; +import App from "src/App"; ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( diff --git a/coral/tsconfig.json b/coral/tsconfig.json index b16a9bff58..30aea56764 100644 --- a/coral/tsconfig.json +++ b/coral/tsconfig.json @@ -1,9 +1,6 @@ { "compilerOptions": { "baseUrl": ".", - "paths": { - "@/*": ["src/*"] - }, "target": "ESNext", "useDefineForClassFields": true, "lib": ["DOM", "DOM.Iterable", "ESNext"], diff --git a/coral/vite.config.ts b/coral/vite.config.ts index 307027d698..504312d7e8 100644 --- a/coral/vite.config.ts +++ b/coral/vite.config.ts @@ -2,10 +2,7 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import { resolve } from "path"; -const rootPath = resolve(__dirname); // https://vitejs.dev/config/ - -// console.log("rootPath", rootPath); export default defineConfig({ plugins: [react()], define: { @@ -22,7 +19,7 @@ export default defineConfig({ }, resolve: { alias: { - "@": resolve(rootPath, "./src"), + src: resolve(resolve(__dirname), "./src"), }, }, });