From ee658a67e4f3b7b5a6cd38ec9b4721cf95a14dd2 Mon Sep 17 00:00:00 2001 From: Timothy Lin Date: Tue, 10 Sep 2024 23:27:02 +0800 Subject: [PATCH] support tsconfig path alias --- packages/@contentlayer/core/src/getConfig/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/@contentlayer/core/src/getConfig/index.ts b/packages/@contentlayer/core/src/getConfig/index.ts index f0921ecf..59e1eb0c 100644 --- a/packages/@contentlayer/core/src/getConfig/index.ts +++ b/packages/@contentlayer/core/src/getConfig/index.ts @@ -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)) {