Skip to content

Commit c0d19eb

Browse files
authored
chore: configure absolute paths with webpack (#3011)
* coonfigure absolute paths with webpack resolves #1855 * fixed jest config
1 parent 6d1ec40 commit c0d19eb

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

site/jest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = {
2727
testEnvironment: "jsdom",
2828
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
2929
testPathIgnorePatterns: ["/node_modules/", "/__tests__/fakes", "/e2e/"],
30-
moduleDirectories: ["node_modules", "<rootDir>"],
30+
moduleDirectories: ["node_modules", "<rootDir>/src"],
3131
moduleNameMapper: {
3232
"\\.css$": "<rootDir>/src/testHelpers/styleMock.ts",
3333
},

site/src/pages/WorkspacesPage/WorkspacesPage.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { useMachine } from "@xstate/react"
22
import { FC, useEffect } from "react"
33
import { Helmet } from "react-helmet"
44
import { useSearchParams } from "react-router-dom"
5-
import { workspaceFilterQuery } from "../../util/filters"
6-
import { pageTitle } from "../../util/page"
7-
import { workspacesMachine } from "../../xServices/workspaces/workspacesXService"
5+
import { workspaceFilterQuery } from "util/filters"
6+
import { pageTitle } from "util/page"
7+
import { workspacesMachine } from "xServices/workspaces/workspacesXService"
88
import { WorkspacesPageView } from "./WorkspacesPageView"
99

1010
const WorkspacesPage: FC = () => {

site/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"resolveJsonModule": true,
1414
"skipLibCheck": true,
1515
"strict": true,
16-
"target": "es2018"
16+
"target": "es2018",
17+
"baseUrl": "./src"
1718
},
1819
"include": ["**/*.ts", "**/*.tsx"],
1920
"exclude": ["node_modules", "_jest"]

site/webpack.common.ts

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export const createCommonWebpackConfig = (options?: { skipTypecheck: boolean }):
103103
//
104104
// See: https://webpack.js.org/guides/typescript/
105105
extensions: [".tsx", ".ts", ".js"],
106+
modules: [path.resolve(__dirname, "src"), "node_modules"],
106107
},
107108

108109
// plugins customize the build process

0 commit comments

Comments
 (0)