Skip to content

Commit

Permalink
support tsconfig path alias
Browse files Browse the repository at this point in the history
  • Loading branch information
timlrx committed Sep 10, 2024
1 parent 4876412 commit ee658a6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/@contentlayer/core/src/getConfig/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,10 @@ const contentlayerGenPlugin = (): esbuild.Plugin => ({
},
})

// TODO also take tsconfig.json `paths` mapping into account
const makeAllPackagesExternalPlugin = (configPath: string): esbuild.Plugin => ({
name: 'make-all-packages-external',
setup: (build) => {
const filter = /^[^.\/]|^\.[^.\/]|^\.\.[^\/]/ // Must not start with "/" or "./" or "../"
const filter = /^[^.\/@~$#]|^\.[^.\/]|^\.\.[^\/]/ // Must not start with "/", "./", "../", "@", "~", "$" or "#"
build.onResolve({ filter }, (args) => {
// avoid marking config file as external
if (args.path.includes(configPath)) {
Expand Down

0 comments on commit ee658a6

Please sign in to comment.