Replies: 2 comments 8 replies
-
Here is Node.js API docs: https://github.com/browserslist/browserslist?tab=readme-ov-file#js-api You should use something like: function getBrowserslistQueries(): string[] {
return browserslist();
} Calling |
Beta Was this translation helpful? Give feedback.
7 replies
-
The simpler way to do it is just to use browserslist.loadConfig({path: process.cwd()}) ?? [...browserslist.defaults] I improved docs 9320799 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I tried to look around and wasn't sure to know where the Node API is documented.
Also, if it's not documented, can we expect that you maintain semver retrocompatibility on it?
Context
For the Docusaurus framework, I'm working on adding opt-in experimental Rspack support.
It has built-in LightningCSS support with a slightly different API.
targets
is something likebrowserslistToTargets(browserslist(queries))
targets
is a list of browserslist queries directly (they did that to avoid installing an extra conversion package exposingbrowserslistToTargets
)It seems I'm able to read the current browserslist queries with the following code:
I was wondering if this code is safe for framework usage with unpinned dependency, and if there's not a simpler way to achieve the same?
Beta Was this translation helpful? Give feedback.
All reactions