mirror of
https://github.com/aleleba/create-react-ssr.git
synced 2025-06-19 20:38:31 -06:00
PR-420915: Changing the logic for aliases for one source of truth on tsconfig.json and updating packages.
This commit is contained in:
@ -1,11 +1,17 @@
|
||||
const { pathsToModuleNameMapper } = require("ts-jest");
|
||||
const { compilerOptions } = require("./tsconfig");
|
||||
|
||||
const aliases = pathsToModuleNameMapper(compilerOptions.paths, {
|
||||
prefix: "<rootDir>"
|
||||
})
|
||||
|
||||
module.exports = {
|
||||
setupFilesAfterEnv: ['<rootDir>/setupTest.ts'],
|
||||
"testEnvironment": "jsdom",
|
||||
testEnvironment: "jsdom",
|
||||
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json"],
|
||||
moduleNameMapper: {
|
||||
...aliases,
|
||||
"\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/src/__mocks__/fileMock.ts",
|
||||
"@components": "<rootDir>/src/frontend/components/",
|
||||
"@styles": "<rootDir>/src/frontend/styles/",
|
||||
"@config": "<rootDir>/config/",
|
||||
"\\.(css|sass|scss|less)$": "identity-obj-proxy"
|
||||
},
|
||||
};
|
||||
"\\.(css|sass|scss|less)$": "identity-obj-proxy",
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user