Bundle third-party.js in ESM (#13509)
This commit is contained in:
1 parent
16c9d8bafe
commit
5465517f4b
3 files changed
+4
-3
No files matched your search
@@ -218,7 +218,7 @@ function* getEsbuildOptions(bundle, buildOptions) {
|
||||
esbuildOptions.platform = "node";
|
||||
esbuildOptions.external.push(...bundledFiles.map(({ output }) => output));
|
||||
|
||||
if (interopDefault) {
|
||||
if (bundle.format !== "esm" && interopDefault) {
|
||||
esbuildOptions.plugins.push(esbuildPluginInteropDefault());
|
||||
}
|
||||
|
||||
|
||||
@@ -279,11 +279,12 @@ const coreBundles = [
|
||||
output: "cli.mjs",
|
||||
format: "esm",
|
||||
external: ["benchmark"],
|
||||
interopDefault: false,
|
||||
replaceModule: [replaceDiffPackageEntry("lib/patch/create.js")],
|
||||
},
|
||||
{
|
||||
input: "src/common/third-party.js",
|
||||
output: "third-party.mjs",
|
||||
format: "esm",
|
||||
replaceModule: [
|
||||
// cosmiconfig@6 -> import-fresh can't find parentModule, since module is bundled
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ const prettierCli = path.join(
|
||||
);
|
||||
|
||||
const thirdParty = isProduction
|
||||
? path.join(PRETTIER_DIR, "./third-party.js")
|
||||
? path.join(PRETTIER_DIR, "./third-party.mjs")
|
||||
: path.join(PRETTIER_DIR, "./src/common/third-party.js");
|
||||
|
||||
const projectRoot = path.join(__dirname, "../..");
|
||||
|
||||
Reference in new issue
Block a user