Skip to content

Commit 26b41e8

Browse files
authored
fix(@swc/types): Add jsc.output.charset (#10567)
**Description:** Add TypeScript definition for `jsc.output.charset` Ref: - https://swc.rs/docs/configuration/compilation#jscoutputcharset - #4708 - #7258
1 parent 72b1efe commit 26b41e8

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

bindings/binding_core_wasm/src/types.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,15 @@ export interface JscConfig {
684684
minify?: JsMinifyOptions;
685685
686686
preserveAllComments?: boolean;
687+
688+
output?: {
689+
/**
690+
* This can be used to keep the output ascii-only.
691+
* If this option is set, `minify.format.asciiOnly` will be ignored.
692+
* @default 'utf8'
693+
*/
694+
charset?: 'utf8' | 'ascii';
695+
}
687696
}
688697
689698
export type JscTarget =

bindings/binding_minifier_wasm/src/types.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,15 @@ export interface JscConfig {
684684
minify?: JsMinifyOptions;
685685
686686
preserveAllComments?: boolean;
687+
688+
output?: {
689+
/**
690+
* This can be used to keep the output ascii-only.
691+
* If this option is set, `minify.format.asciiOnly` will be ignored.
692+
* @default 'utf8'
693+
*/
694+
charset?: 'utf8' | 'ascii';
695+
}
687696
}
688697
689698
export type JscTarget =

packages/types/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,15 @@ export interface JscConfig {
704704
minify?: JsMinifyOptions;
705705

706706
preserveAllComments?: boolean;
707+
708+
output?: {
709+
/**
710+
* This can be used to keep the output ascii-only.
711+
* If this option is set, `minify.format.asciiOnly` will be ignored.
712+
* @default 'utf8'
713+
*/
714+
charset?: 'utf8' | 'ascii';
715+
}
707716
}
708717

709718
export type JscTarget =

0 commit comments

Comments
 (0)