Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/many-ants-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@callstack/repack": patch
---

Make `platform` option of DevelopmentPlugin optional
7 changes: 5 additions & 2 deletions packages/repack/src/plugins/DevelopmentPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ type PackageJSON = { version: string };
* {@link DevelopmentPlugin} configuration options.
*/
export interface DevelopmentPluginConfig {
platform: string;
/**
* Target application platform.
*/
platform?: string;
}

/**
Expand Down Expand Up @@ -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),
Expand Down