Skip to content

Commit

Permalink
Change alias to src.
Browse files Browse the repository at this point in the history
  • Loading branch information
programmiri committed Oct 26, 2022
1 parent b2d08f6 commit dd0a9eb
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
4 changes: 2 additions & 2 deletions coral/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ export default {
moduleFileExtensions: ["js", "jsx", "ts", "tsx"],
preset: "ts-jest",
testEnvironment: "jsdom",
setupFilesAfterEnv: ['<rootDir>/test-setup/setup-files-after-env.ts'],
setupFilesAfterEnv: ["<rootDir>/test-setup/setup-files-after-env.ts"],
moduleNameMapper: {
".+\\.(png|jpg|ttf|woff|woff2|svg)$": "jest-transform-stub",
"\\.css$": "identity-obj-proxy",
"^@/(.*)$": "<rootDir>/src/$1",
"^src/(.*)$": "<rootDir>/src/$1",
},
};
2 changes: 1 addition & 1 deletion coral/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -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", () => {
Expand Down
2 changes: 1 addition & 1 deletion coral/src/main.tsx
Original file line number Diff line number Diff line change
@@ -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(
<React.StrictMode>
Expand Down
3 changes: 0 additions & 3 deletions coral/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
Expand Down
5 changes: 1 addition & 4 deletions coral/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -22,7 +19,7 @@ export default defineConfig({
},
resolve: {
alias: {
"@": resolve(rootPath, "./src"),
src: resolve(resolve(__dirname), "./src"),
},
},
});

0 comments on commit dd0a9eb

Please sign in to comment.