Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Sep 1, 2024
1 parent 48ff0ec commit 77f53c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/server/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,12 @@ export const getAddressUrls = ({
};

// A unique name for WebSocket communication
const COMPILATION_ID_REGEX = /[^a-zA-Z0-9_-]/g;
export const getCompilationId = (
compiler: Rspack.Compiler | Rspack.Compilation,
) => {
const uniqueName = compiler.options.output.uniqueName ?? '';
return `${compiler.name ?? ''}_${uniqueName.replace(/[^a-zA-Z0-9_-]/g, '_')}`;
return `${compiler.name ?? ''}_${uniqueName.replace(COMPILATION_ID_REGEX, '_')}`;
};

export function getServerTerminator(
Expand Down

0 comments on commit 77f53c8

Please sign in to comment.