-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-exporting a sub-module #119
Comments
We use this exact same pattern at work without issue. What bundler/environment are you using? |
I get this error when I want to use these with Jest (
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"sourceMap": true,
"incremental": true,
"skipLibCheck": true,
"noImplicitOverride": true,
"rootDir": "./",
"outDir": "./dist",
"noImplicitAny": false,
"strictBindCallApply": false,
"forceConsistentCasingInFileNames": false,
"noFallthroughCasesInSwitch": false,
"strict": true,
"declarationMap": true,
"moduleResolution": "node",
"typeRoots": [
"node_modules/@types",
"../@types"
],
"paths": {
"@core": [
"."
],
"@core/*": [
"./*"
]
}
},
"exclude": [
"node_modules",
"dist"
]
}
"jest": {
"testEnvironment": "node",
"setupFilesAfterEnv": [
"@relmify/jest-fp-ts",
"jest-extended/all"
],
"moduleFileExtensions": [
"js",
"ts",
"json"
],
"moduleNameMapper": {
"^@core(.*)": "<rootDir>/..$1"
},
"moduleDirectories": [
"node_modules",
"<rootDir>"
],
"rootDir": "test",
"testRegex": ".*\\.test\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage"
} So I have this configuration and with these, when I try to re-export from the This information might be useful:
|
Is this the issue perhaps?: #89 |
Seems so yeah |
Hello,
I was trying to have my utility functions along with the library function, so I have created a barrel file (
index
) to export everything from the files I had and a sub-module of this library, likeRecord
.When I use TypeScript, there is no type error but I cannot get it work if I have the following setup:
The text was updated successfully, but these errors were encountered: