From c5617841cc67a482cdd2580e3a8b74f281373dda Mon Sep 17 00:00:00 2001 From: Joseph Wang Date: Thu, 5 Mar 2020 11:42:00 +0800 Subject: [PATCH] (fix): don't treat @/ ~/ alias as external module --- src/createRollupConfig.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/createRollupConfig.ts b/src/createRollupConfig.ts index 0092baf28..b637f34e7 100644 --- a/src/createRollupConfig.ts +++ b/src/createRollupConfig.ts @@ -56,6 +56,12 @@ export async function createRollupConfig( if (id === 'babel-plugin-transform-async-to-promises/helpers') { return false; } + /** + * ~/ or @/ for srcDir + */ + if (id.startsWith('@/') || id.startsWith('~/')) { + return false; + } return external(id); }, // Rollup has treeshaking by default, but we can optimize it further...