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, }),