-
Notifications
You must be signed in to change notification settings - Fork 503
Absolute imports / TS Paths aliases get treated as externals #528
Copy link
Copy link
Closed
Labels
solution: duplicateThis issue or pull request already existsThis issue or pull request already existssolution: workaround availableThere is a workaround available for this issueThere is a workaround available for this issuetopic: TS Paths AliasesRelated to using aliases with TypeScript pathsRelated to using aliases with TypeScript paths
Description
Hi. I am trying to create a small components lib + styleguidist playground.
Playground works fine (it uses webpack), but my build is broken. I created a dist folder, npm pack-ed it, installed locally in another project.
import { Button } from "components-lib";
Module not found: Can't resolve 'components/Button'
My index.ts looks like this:
export { default as Button } from "components/Button";
export { default as Checkbox } from "components/Checkbox";
export { default as Icon } from "components/Icon";
export { default as SideMenu } from "components/SideMenu";
I get no errors during build.
My tsconfig:
{
"include": ["src", "@types", "test"],
"compilerOptions": {
"target": "es5",
"module": "esnext",
"lib": ["dom", "esnext"],
"importHelpers": true,
"declaration": true,
"sourceMap": true,
"rootDir": "./",
"strict": true,
"noImplicitAny": false,
"strictNullChecks": false,
"strictFunctionTypes": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"baseUrl": "./",
"paths": {
"*": ["src/*", "node_modules/*"]
},
"jsx": "react",
"resolveJsonModule": true,
"esModuleInterop": true,
"isolatedModules": true,
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
solution: duplicateThis issue or pull request already existsThis issue or pull request already existssolution: workaround availableThere is a workaround available for this issueThere is a workaround available for this issuetopic: TS Paths AliasesRelated to using aliases with TypeScript pathsRelated to using aliases with TypeScript paths
