diff --git a/.changeset/many-ants-rescue.md b/.changeset/many-ants-rescue.md new file mode 100644 index 000000000..b1db925b1 --- /dev/null +++ b/.changeset/many-ants-rescue.md @@ -0,0 +1,5 @@ +--- +"@callstack/repack": patch +--- + +Make `platform` option of DevelopmentPlugin optional diff --git a/packages/repack/src/plugins/DevelopmentPlugin.ts b/packages/repack/src/plugins/DevelopmentPlugin.ts index bd8555d01..290f608b0 100644 --- a/packages/repack/src/plugins/DevelopmentPlugin.ts +++ b/packages/repack/src/plugins/DevelopmentPlugin.ts @@ -19,7 +19,10 @@ type PackageJSON = { version: string }; * {@link DevelopmentPlugin} configuration options. */ export interface DevelopmentPluginConfig { - platform: string; + /** + * Target application platform. + */ + platform?: string; } /** @@ -103,7 +106,7 @@ export class DevelopmentPlugin implements RspackPluginInstance { const host = compiler.options.devServer.host; const port = compiler.options.devServer.port; const protocol = this.getProtocolType(compiler.options.devServer); - const platform = this.config.platform; + const platform = this.config.platform ?? (compiler.options.name as string); new compiler.webpack.DefinePlugin({ __PLATFORM__: JSON.stringify(platform),