-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Motivation
Greenwood by default only supports three of the standard export conditions as defined in the NodeJS docs; import, module-sync, and default
- https://greenwoodjs.dev/docs/introduction/web-standards/#import-maps
- https://github.com/ProjectEvergreen/greenwood/blob/v0.34.0-alpha.0/packages/cli/src/lib/walker-package-ranger.js#L5
For example, worker or browser - https://app.unpkg.com/[email protected]/files/package.json#L129
"./web": {
"worker": {
"types": "./web/types/index.d.ts",
"import": "./web/dist/server.js",
"require": "./web/dist/server.cjs"
},
"browser": {
"development": {
"types": "./web/types/index.d.ts",
"import": "./web/dist/dev.js",
"require": "./web/dist/dev.cjs"
},
}
// ...
},Technical Design
This is probably something Greenwood could handle through configuration most likely, since custom user conditions are valid through the exports map spec.
export default {
importMap: {
conditions: ['worker', 'browser']
}
}Basically we just want to add them the existing list
https://github.com/ProjectEvergreen/greenwood/blob/v0.34.0-alpha.0/packages/cli/src/lib/walker-package-ranger.js#L5
Would want to add a test case for this.
Additional Context
#1436 (can close this one out after we release this)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
🔖 Ready