Skip to content

Conversation

leekeh
Copy link

@leekeh leekeh commented May 19, 2025

The browser field in Prettier’s package.json points to standalone.js. That’s why you can just import or require the prettier module to access Prettier’s API, and your code can stay compatible with both Node and the browser as long as webpack or another bundler that supports the browser field is used. This is especially convenient for plugins.

from https://prettier.io/docs/browser

If the same structure is used for prettier-plugin-svelte, it will be a smoother experience for developers. I know this version is still unsupported, but loading the node version will be worse.

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 this pull request may close these issues.

1 participant