every-plugin
Version:
1 lines • 892 B
Source Map (JSON)
{"version":3,"file":"normalize.cjs","names":[],"sources":["../../../src/runtime/services/normalize.ts"],"sourcesContent":["/**\n * Normalizes a package name into the module federation remote name.\n * This function must produce identical results in both runtime and build contexts.\n *\n * Normalization rules:\n * - Convert to lowercase\n * - Strip a single leading '@' symbol\n * - Replace '/' with '_'\n * - Preserve hyphens and other characters\n *\n * Examples:\n * - \"@scope/my-plugin\" → \"scope_my-plugin\"\n * - \"@SCOPE/Foo/Bar\" → \"scope_foo_bar\"\n * - \"foo/bar\" → \"foo_bar\"\n * - \"simple-plugin\" → \"simple-plugin\"\n */\nexport const getNormalizedRemoteName = (name: string): string =>\n name.toLowerCase().replace(/^@/, \"\").replace(/\\//g, \"_\");\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgBA,MAAa,2BAA2B,SACtC,KAAK,aAAa,CAAC,QAAQ,MAAM,GAAG,CAAC,QAAQ,OAAO,IAAI"}