Skip to content

Commit

Permalink
Apply change from #15157
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Aug 14, 2023
1 parent 1027e59 commit de94bcc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 12 additions & 4 deletions scripts/build/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import path from "node:path";
import url from "node:url";
import fs from "node:fs";
import { createRequire } from "node:module";
import createEsmUtils from "esm-utils";
import { PROJECT_ROOT, DIST_DIR, copyFile } from "../utils/index.js";
import buildJavascriptModule from "./build-javascript-module.js";
Expand Down Expand Up @@ -426,11 +425,20 @@ const nonPluginUniversalFiles = [
umdVariableName: "prettier",
replaceModule: [
{
module: require.resolve("@babel/highlight"),
path: path.join(dirname, "./shims/babel-highlight.js"),
module: require.resolve("@babel/highlight", {
paths: [require.resolve("@babel/code-frame")],
}),
},
{
module: createRequire(require.resolve("vnopts")).resolve("chalk"),
module: require.resolve("chalk", {
paths: [require.resolve("@babel/code-frame")],
}),
path: path.join(dirname, "./shims/chalk.js"),
},
{
module: require.resolve("chalk", {
paths: [require.resolve("vnopts")],
}),
path: path.join(dirname, "./shims/chalk.js"),
},
replaceDiffPackageEntry("lib/diff/array.js"),
Expand Down
4 changes: 1 addition & 3 deletions scripts/build/shims/babel-highlight.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
import chalk from "./chalk.js";

export const shouldHighlight = () => false;
export const getChalk = () => chalk;
export default String;

0 comments on commit de94bcc

Please sign in to comment.