MCPcopy
hub / github.com/originjs/vite-plugin-federation / parseSharedOptions

Function parseSharedOptions

packages/lib/src/utils/index.ts:57–81  ·  view source on GitHub ↗
(
  options: VitePluginFederationOptions
)

Source from the content-addressed store, hash-verified

55}
56
57export function parseSharedOptions(
58 options: VitePluginFederationOptions
59): (string | ConfigTypeSet)[] {
60 return parseOptions(
61 options.shared || {},
62 (value, key) => ({
63 import: true,
64 shareScope: 'default',
65 packagePath: key,
66 // Whether the path is set manually
67 manuallyPackagePathSetting: false,
68 generate: true,
69 modulePreload: false
70 }),
71 (value, key) => {
72 value.import = value.import ?? true
73 value.shareScope = value.shareScope || 'default'
74 value.packagePath = value.packagePath || key
75 value.manuallyPackagePathSetting = value.packagePath !== key
76 value.generate = value.generate ?? true
77 value.modulePreload = value.modulePreload ?? false
78 return value
79 }
80 )
81}
82
83export function parseExposeOptions(
84 options: VitePluginFederationOptions

Callers 2

devSharedPluginFunction · 0.90
prodSharedPluginFunction · 0.90

Calls 1

parseOptionsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…