Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge package.json "exports" with template instead of overwritting #105

Closed
Goodwine opened this issue Jun 27, 2022 · 1 comment · Fixed by #106
Closed

Merge package.json "exports" with template instead of overwritting #105

Goodwine opened this issue Jun 27, 2022 · 1 comment · Fixed by #106

Comments

@Goodwine
Copy link
Contributor

when having a package.json file with exports like

"exports": {
  "types": "./path/to/types"
}

This currently becomes

"exports": {
  "default": "./${pkg}.default.dart.js"
}

Ideally this should become

"exports": {
  "types": "./path/to/types"
  "default": "./${pkg}.default.dart.js"
}

Note that "exports" can also be string|string[], so the feature request is to keep the behavior of overwriting the field if it was either string|string[]|undefined|null however when the field had value {} (or Map in dart) then use the spread operator and only overwrite "node", "browser", and "default" when specified.

See sass/dart-sass#1714

@Goodwine
Copy link
Contributor Author

An alternative would have been defining a new configuration for "types" and then include it in exports but that knob becomes very fragile and it's better to just rely on merging the objects IMO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant