-
Notifications
You must be signed in to change notification settings - Fork 116
Description
Love the style
support, but would really helpful for conditional exports to also be legible to postcss-import
:
{
...,
"exports": {
".": "./dist/index.js",
"./*": "./dist/lib/*/index.js",
"./styles": "./dist/styles/index.css",
"./styles/*": "./dist/styles/*/index.css",
"./package.json": "./package.json"
},
...,
}
The main reason I suggest this is because I cannot specify an @import "my-package/styles"
statement in a way that is supported by both esbuild (supports standardized package.json exports
, but not nonstandard style
) and postcss-import
(where situation is reversed). my-package/styles
is the only thing that works for esbuild, but my-package
is the only thing that works for postcss-import
.
I would recommend following the Node doctrine of "if exports
exists, it overrides anything else" (i.e. style
field). Also thank you for maintaining this project, it is a core part of modern development workflows IMO, only reason I suggest the enhancement.