You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add tsconfig.json option for baseUrl or paths option, for example "baseUrl": "./src" or "paths": {"@/*", "./src/*"}
import anything using the aliases
it breaks with module not found error
Expected to work without issue
I see that the esbuild custom plugin to blame here which excludes anything not starting with . as external.
I have came across this page: https://janessagarrow.com/blog/typescript-and-esbuild/ which has example using package.json dependencies as external.
I have tried it and that works with @manypkg/find-root. I had to get the package.json dependencies and mark them external rather than the custom plugin. I prefer using find-root instead of just getting cwd+package.json in getEsbuildConfig, this enable use case where keystone cli is used from within another package.
Something akin to Next.js's transpilePackages feature might work well, but I think the main difficulty is how to actually specify said configuration, given that the entire Keystone configuration currently lives in the file that gets transpiled.
tsconfig.json
option forbaseUrl
orpaths
option, for example"baseUrl": "./src"
or"paths": {"@/*", "./src/*"}
it breaks with module not found error
Expected to work without issue
I see that the esbuild custom plugin to blame here which excludes anything not starting with
.
as external.I have came across this page: https://janessagarrow.com/blog/typescript-and-esbuild/ which has example using
package.json
dependencies as external.I have tried it and that works with
@manypkg/find-root
. I had to get the package.json dependencies and mark them external rather than the custom plugin. I prefer usingfind-root
instead of just gettingcwd+package.json
ingetEsbuildConfig
, this enable use case where keystone cli is used from within another package.if interested, I can add example here.
Also found some example to achieve this as evanw/esbuild#619 (comment)
The text was updated successfully, but these errors were encountered: