diff --git a/packages/community-cli-plugin/src/commands/bundle/buildBundle.js b/packages/community-cli-plugin/src/commands/bundle/buildBundle.js index f5e629f4ccacad..cce7c0030bc81f 100644 --- a/packages/community-cli-plugin/src/commands/bundle/buildBundle.js +++ b/packages/community-cli-plugin/src/commands/bundle/buildBundle.js @@ -42,6 +42,7 @@ export type BundleCommandArgs = { verbose: boolean, unstableTransformProfile: string, indexedRamBundle?: boolean, + customResolverOptions?: Record, }; async function buildBundle( @@ -99,6 +100,7 @@ async function buildBundleWithConfig( minify: args.minify !== undefined ? args.minify : !args.dev, platform: args.platform, unstable_transformProfile: args.unstableTransformProfile, + customResolverOptions: args.customResolverOptions, }; const server = new Server(config); diff --git a/packages/community-cli-plugin/src/commands/bundle/index.js b/packages/community-cli-plugin/src/commands/bundle/index.js index 5dba17d220b47e..46f7827dbbf320 100644 --- a/packages/community-cli-plugin/src/commands/bundle/index.js +++ b/packages/community-cli-plugin/src/commands/bundle/index.js @@ -114,6 +114,18 @@ const bundleCommand: Command = { description: 'Path to the CLI configuration file', parse: (val: string): string => path.resolve(val), }, + { + name: '--custom-resolver-options ', + description: 'Custom resolver options, format: key=value,key2=value2.', + parse: (val: string): Record => { + return Object.fromEntries( + val.split(',').map(option => { + const [key, value] = option.split('='); + return [key, value]; + }), + ); + }, + }, ], };