Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prettierx docs: update browser status for prettierX #618

Merged
merged 3 commits into from
Jun 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions docs/browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ id: browser
title: Browser
---

## browser status for prettierX

This documentation does **not** apply for prettierX. The recommended solution is to use a bundler such as Rollup or Webpack. This is tracked with some more information in: [`brodybits/prettierx#95`](https://github.com/brodybits/prettierx/issues/95)

---

Run Prettier in the browser with the `standalone.js` UMD bundle shipped in the NPM package (starting in version 1.13). The UMD bundle only formats the code and has no support for config files, ignore files, CLI usage, or automatic loading of plugins.

### `prettier.format(code, options)`
Expand All @@ -29,8 +35,8 @@ See [Usage](#usage) below for examples.
### ES Modules

```js
import prettier from "prettierx/standalone";
import parserGraphql from "prettierx/parser-graphql";
import prettier from "prettier/standalone";
import parserGraphql from "prettier/parser-graphql";

prettier.format("query { }", {
parser: "graphql",
Expand All @@ -52,8 +58,8 @@ define([
### CommonJS

```js
const prettier = require("prettierx/standalone");
const plugins = [require("prettierx/parser-graphql")];
const prettier = require("prettier/standalone");
const plugins = [require("prettier/parser-graphql")];
prettier.format("query { }", { parser: "graphql", plugins });
```

Expand Down