[babel 8] Output minimal strings by default (#12675)

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Co-authored-by: Justin Ridgewell <jridgewell@google.com>
This commit is contained in:
Huáng Jùnliàng
2021-01-23 16:50:07 -05:00
committed by GitHub
parent 464a02ffe1
commit cd090e9842
37 changed files with 231 additions and 12 deletions

View File

@@ -203,8 +203,6 @@ export function StringLiteral(node: Object) {
return;
}
// ensure the output is ASCII-safe
const val = jsesc(
node.value,
process.env.BABEL_8_BREAKING

View File

@@ -55,6 +55,7 @@ function normalizeOptions(code, opts): Format {
jsescOption: {
quotes: "double",
wrap: true,
minimal: true,
...opts.jsescOption,
},
recordAndTupleSyntaxType: opts.recordAndTupleSyntaxType,
@@ -62,6 +63,7 @@ function normalizeOptions(code, opts): Format {
if (!process.env.BABEL_8_BREAKING) {
format.jsonCompatibleStrings = opts.jsonCompatibleStrings;
delete format.jsescOption.minimal;
}
if (format.minified) {