From 07485d372ec4aaf4d58a58410dbac40311989b61 Mon Sep 17 00:00:00 2001 From: OJ Kwon Date: Wed, 16 Feb 2022 02:10:05 -0800 Subject: [PATCH] refactor(node-swc/types): Provide typed configuration for plugins (#3584) --- node-swc/src/types.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/node-swc/src/types.ts b/node-swc/src/types.ts index ed790d11150..717c64b6205 100644 --- a/node-swc/src/types.ts +++ b/node-swc/src/types.ts @@ -492,7 +492,21 @@ export interface JscConfig { experimental?: { optimizeHygiene?: boolean, - keepImportAssertions?: boolean + keepImportAssertions?: boolean, + /** + * Specify the location where SWC stores its intermidiate cache files. + * Currently only transform plugin uses this. If not specified, SWC will + * create `.swc` directories. + */ + cacheRoot: string; + /** + * List of custom transform plugins written in WebAssembly. + * First parameter of tuple indicates the name of the plugin - it can be either + * a name of the npm package can be resolved, or absolute path to .wasm binary. + * + * Second parameter of tuple is JSON based configuration for the plugin. + */ + plugins: Array<[string, Record]> }, baseUrl?: string