Skip to content

Native ESM support #8772

@sosukesuzuki

Description

@sosukesuzuki

We have documents for ESM import on browser but it needs using some module bundler (e.g. webpack, rollup). (See https://prettier.io/docs/en/browser.html#es-modules)
I thinks we should have native ESM standalone bundled. I hope we can use Prettier like below:

import prettier from "https://unpkg.com/[email protected]/standalone.m.js";
import parserGraphql from "https://unpkg.com/[email protected]/parser-graphql.m.js";

prettier.format("query { }", {
  parser: "graphql",
  plugins: [parserGraphql],
});

WDYT?

Metadata

Metadata

Labels

area:standaloneIssues with Prettier's Standalone build (meant to be used in the browser)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions