-
Notifications
You must be signed in to change notification settings - Fork 507
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
Absolute imports / TS Paths aliases get treated as externals #528
Comments
I also don't see any static assets 😔
|
This could be related with how externals are configured (which I found recently):
Try using relative imports, e.g. 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"; Same goes for your static assets, assuming you're importing them. |
Seems to be the case for components, assets (svg) are still missing. Maybe they are included inline in build? Edit: they are Also how can I fix imports? I tried with aliases and it still didn't work. I don't want to look at '../../' |
Yeah unfortunately the rollup config has a lot to be desired in that way. For rollup aliases appear to be possible, see: https://github.com/rollup/plugins/tree/master/packages/alias |
Many thanks! |
Yep as @lpolito said, non-relative imports are treated as externals. Regarding aliases, you can check out the HOWTO on that at #379 (comment) . Potentially related, there was a PR for TS paths -> alias support, but the TypeScript team's position is that |
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.
My index.ts looks like this:
I get no errors during build.
My tsconfig:
The text was updated successfully, but these errors were encountered: