Skip to content
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

Be able to use workspaces dependencies and tsconfig paths in contentlayer.config.ts #608

Open
gustaveWPM opened this issue Nov 28, 2023 · 7 comments

Comments

@gustaveWPM
Copy link

gustaveWPM commented Nov 28, 2023

Hello.

I think it would be great to be able to use workspaces and Typescript paths related dependencies in contentlayer.config.ts.

For instance, if I try it in my tailwind.config.ts

// tailwind.config.ts
import { buildPathFromParts } from '@repo/shared-lib/str';
console.log(buildPathFromParts('hello', 'world'));

All works as intended.

But if I do the same in contentlayer.config.ts

Then, I get an error:

ConfigReadError (/home/me/Delivery/project/contentlayer.config.ts): Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/me/Delivery/project/node_modules/@repo/shared-lib/str' imported from /home/me/Delivery/project/.contentlayer/.cache/v0.3.4/compiled-contentlayer-config-KYFR5QIE.mjs
ConfigReadError (/home/me/Delivery/project/contentlayer.config.ts): Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/me/Delivery/project/node_modules/@repo/shared-lib/str' imported from /home/me/Delivery/project/.contentlayer/.cache/v0.3.4/compiled-contentlayer-config-KYFR5QIE.mjs

It's quite annoying because I can't do anything other than imports with absolute or relative paths.
I can't use the paths in my tsconfig.json, and I can't use some of my third-party libraries, unless I adapt them entirely and have to write everything in relative or absolute path in them too.


EDIT: maybe it's related to ESBuild?

@gustaveWPM gustaveWPM changed the title Be able to use external dependencies in contentlayer.config.ts Be able to use workspaces dependencies and tsconfig paths in contentlayer.config.ts Nov 29, 2023
@gustaveWPM
Copy link
Author

.

Copy link

stale bot commented May 4, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale label May 4, 2024
@gustaveWPM
Copy link
Author

😢

@stale stale bot removed the meta: stale label May 5, 2024
Copy link

stale bot commented Jul 5, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale label Jul 5, 2024
@gustaveWPM
Copy link
Author

.

@stale stale bot removed the meta: stale label Jul 5, 2024
@zhutmost
Copy link

Hi, I have met a similar issue. Do you find any solutions?

@gustaveWPM
Copy link
Author

gustaveWPM commented Sep 1, 2024

no, sorry. This is very tedious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants