@/CivicSignalBlog - Use aliases in Payload CMS #902
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request includes several changes to the
civicsignalblog
application, primarily focusing on using Path aliases for cleaner imports.Additionally, it fixes failing
build-next
due to ESLint that were noted after merging #901.While trying to use path aliases, it was noted that Payload does not resolve the paths as expected, this is dicussed here.
Thus, to resolve this we have:
dev
script with-r tsconfig-paths/register
enabling ts-node to correctly resolve path aliases defined intsconfig.json
tsconfigPathToWebpackAlias.ts
that create path aliases that are used inpayload.config.ts
build-next
script to includetsc-alias -p tsconfig.server.json
that replaces alias paths with relative paths after typescript compilation.P.S
The PR might have many modified files but they are mainly adding aliases. The main concern with this PR is the use of two new packages as a workaround to the Path Alias Issue. While it's not ideal, it appears to be the most viable solution for now. Perhaps we can discover a better approach during our review.
Type of change
Checklist: