Skip to content

Commit

Permalink
Merge pull request #39 from timlrx/path-alias
Browse files Browse the repository at this point in the history
support tsconfig path alias
  • Loading branch information
timlrx authored Sep 12, 2024
2 parents bf332bd + ee658a6 commit a5273e8
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 a5273e8

Please sign in to comment.