Skip to content

Commit

Permalink
prettierx docs: update browser status for prettierX
Browse files Browse the repository at this point in the history
as discussed in this issue:

- #95

and revert updates to `docs/browser.md` from this commit:

- a48be8e
  • Loading branch information
Chris Brody authored Jun 22, 2021
1 parent 0c97cab commit 323f922
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions docs/browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ 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 this issue: [`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 +36,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 +59,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

0 comments on commit 323f922

Please sign in to comment.