Bundle files in ESM (#13266)

This commit is contained in:
fisker Cheung authored and GitHub committed 2022-09-23 09:46:18 +08:00
1 parent 77ac062120
commit 16c9d8bafe
5 files changed
+51 -9

No files matched your search

+6 -1
View File
@@ -7,7 +7,12 @@ function getPrettierInternal() {
return import(entry).then((module) => module.default);
}
const entry = pathToFileURL(path.join(process.env.PRETTIER_DIR, "index.js"));
const entry = pathToFileURL(
path.join(
process.env.PRETTIER_DIR,
process.env.NODE_ENV === "production" ? "index.mjs" : "index.js"
)
);
return import(entry);
}