From 6e8274969c040057351e990a1e04e11a17322762 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 24 Apr 2020 12:43:58 +0200 Subject: [PATCH] packages/cli: make plugin build generate usable declaration maps --- packages/cli/src/commands/plugin/rollup.config.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/cli/src/commands/plugin/rollup.config.ts b/packages/cli/src/commands/plugin/rollup.config.ts index 9c645c5a2e..e267bb9582 100644 --- a/packages/cli/src/commands/plugin/rollup.config.ts +++ b/packages/cli/src/commands/plugin/rollup.config.ts @@ -50,6 +50,12 @@ export default { // The dev folder is for the local plugin serve, ignore it in the build // If we don't do this we get a folder structure similar to dist/{src,dev}/... exclude: ['dev'], + compilerOptions: { + // Use absolute path to src dir as root for declarations, relying on the default + // seems to produce declaration maps that are relative to dist/ instead of src/ + // Using a relative path like ../src doesn't work either becaus it will be used as is in subdirs. + sourceRoot: paths.resolveTarget('src'), + }, }, clean: true, }),