Use @prettier/next (#15732)

This commit is contained in:
fisker Cheung authored and GitHub committed 2023-11-30 13:34:09 +08:00
1 parent 8d64505bd4
commit e8d787ce79
6 files changed
+257 -13

No files matched your search

+8 -8
View File
@@ -7,12 +7,12 @@ var packageJson = require("../package.json");
pleaseUpgradeNode(packageJson);
function runCli(cli) {
return cli.run();
}
var dynamicImport = new Function("module", "return import(module)");
var promise = dynamicImport("../src/cli/index.js").then(runCli);
// Exported for test
module.exports.__promise = promise;
if (process.env.PRETTIER_LEGACY_CLI) {
var promise = dynamicImport("../src/cli/index.js").then(function runCli(cli) {
return cli.run();
});
module.exports.__promise = promise;
} else {
dynamicImport("@prettier/next/bin");
}
+1 -3
View File
@@ -7,6 +7,4 @@ instead of `node bin/prettier.cjs`.
This file should only used for development.
*/
import { run } from "../src/cli/index.js";
await run();
import "./prettier.cjs";