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<