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.
Love the
stylesupport, but would really helpful for conditional exports to also be legible topostcss-import: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.jsonexports, but not nonstandardstyle) andpostcss-import(where situation is reversed).my-package/stylesis the only thing that works for esbuild, butmy-packageis the only thing that works forpostcss-import.I would recommend following the Node doctrine of "if
exportsexists, it overrides anything else" (i.e.stylefield). Also thank you for maintaining this project, it is a core part of modern development workflows IMO, only reason I suggest the enhancement.