From 83d928ca76003ba31f688f6fc2cfb365d83eab94 Mon Sep 17 00:00:00 2001 From: amazli Date: Mon, 10 Mar 2025 17:13:01 +0800 Subject: [PATCH] feat: add sourcemap configuration switch --- src/core/context.ts | 1 + src/types.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/core/context.ts b/src/core/context.ts index 1e40f340..317d82ba 100644 --- a/src/core/context.ts +++ b/src/core/context.ts @@ -39,6 +39,7 @@ export class Context { private rawOptions: Options, ) { this.options = resolveOptions(rawOptions, this.root) + this.sourcemap = rawOptions.sourcemap ?? true this.generateDeclaration = throttle(500, this._generateDeclaration.bind(this), { noLeading: false }) this.setTransformer(this.options.transformer) } diff --git a/src/types.ts b/src/types.ts index ceaa3549..cb43086f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -198,6 +198,13 @@ export interface Options { * Vue version of project. It will detect automatically if not specified. */ version?: 2 | 2.7 | 3 + + /** + * Generate sourcemap for the transformed code. + * + * @default true + */ + sourcemap?: boolean } export type ResolvedOptions = Omit<