Drop color support for standalone build (#12182)
This commit is contained in:
1 parent
08da4e55b0
commit
e3efd11401
3 files changed
+25
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import path from "node:path";
|
||||
import { createRequire } from "node:module";
|
||||
import createEsmUtils from "esm-utils";
|
||||
|
||||
const { require } = createEsmUtils(import.meta);
|
||||
@@ -184,6 +185,13 @@ const coreBundles = [
|
||||
input: "src/standalone.js",
|
||||
name: "prettier",
|
||||
target: "universal",
|
||||
replaceModule: {
|
||||
[require.resolve("@babel/highlight")]: require.resolve(
|
||||
"./shims/babel-highlight.cjs"
|
||||
),
|
||||
[createRequire(require.resolve("vnopts")).resolve("chalk")]:
|
||||
require.resolve("./shims/chalk.cjs"),
|
||||
},
|
||||
},
|
||||
{
|
||||
input: "bin/prettier.js",
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
const chalk = require("./chalk.cjs");
|
||||
const highlight = { shouldHighlight: () => false, getChalk: () => chalk };
|
||||
|
||||
module.exports = highlight;
|
||||
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
const chalk = (x) => x;
|
||||
chalk.grey = chalk;
|
||||
chalk.red = chalk;
|
||||
chalk.bold = chalk;
|
||||
chalk.yellow = chalk;
|
||||
chalk.blue = chalk;
|
||||
chalk.default = chalk;
|
||||
|
||||
module.exports = chalk;
|
||||
Reference in new issue
Block a user