MCPcopy Create free account
hub / github.com/adobe/react-spectrum / enforceExports

Function enforceExports

yarn.config.cjs:246–265  ·  view source on GitHub ↗

@param {Context} context

({Yarn})

Source from the content-addressed store, hash-verified

244
245/** @param {Context} context */
246function enforceExports({Yarn}) {
247 // make sure build fields are correctly set
248 for (const workspace of Yarn.workspaces()) {
249 let name = workspace.ident;
250 if (isPublishing(workspace) && workspace.manifest.rsp?.type !== 'cli') {
251 // better to do in enforceCSS? it doesn't match the set of packages handled
252 if (name !== 'react-aria-components') {
253 if (
254 name.includes('@react-spectrum') ||
255 name.includes('@adobe/react-spectrum') ||
256 name.includes('@react-aria/visually-hidden')
257 ) {
258 workspace.set('sideEffects', ['*.css']);
259 } else {
260 workspace.set('sideEffects', false);
261 }
262 }
263 }
264 }
265}
266
267function enforceDevMirroringPeerDependencies({Yarn}) {
268 for (const workspace of Yarn.workspaces()) {

Callers 1

yarn.config.cjsFile · 0.85

Calls 2

isPublishingFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected