Skip to content

Commit dffbff4

Browse files
Import Prettier from prettier/standalone (#1024)
The import from `prettier` includes support for all languages supported by Prettier. The `prettier/standalone` import only includes the core. The `prettier` export also points to `prettier/standalone` for the `browser` export condition. This means that with this change `yaml-language-server` has to load less code, leading to faster startup time. And depending on configuration, it may lead to smaller bundle sizes. Co-authored-by: Muthurajan Sivasubramanian <[email protected]>
1 parent 96feb3d commit dffbff4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/languageservice/services/yamlFormatter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66

77
import { Range, Position, TextEdit, FormattingOptions } from 'vscode-languageserver-types';
88
import { CustomFormatterOptions, LanguageSettings } from '../yamlLanguageService';
9-
import { format, Options } from 'prettier';
9+
import { Options } from 'prettier';
1010
import * as parser from 'prettier/plugins/yaml';
11+
import { format } from 'prettier/standalone';
1112
import { TextDocument } from 'vscode-languageserver-textdocument';
1213

1314
export class YAMLFormatter {

0 commit comments

Comments
 (0)