@tinacms/scripts 1.6.3 → 1.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +14 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  // src/index.ts
7
7
  import * as fs from "fs";
8
8
  import { exec } from "child_process";
9
+ import { createRequire } from "module";
9
10
  import path from "path";
10
11
  import chalk from "chalk";
11
12
  import chokidar from "chokidar";
@@ -350,6 +351,15 @@ See --help for a list of available commands.`
350
351
  });
351
352
  } else if (["@tinacms/mdx"].includes(packageJSON.name)) {
352
353
  const peerDeps2 = packageJSON.peerDependencies;
354
+ const acornManifest = createRequire(
355
+ path.join(process.cwd(), "package.json")
356
+ ).resolve("acorn/package.json");
357
+ const alias = {
358
+ acorn: path.join(
359
+ path.dirname(acornManifest),
360
+ JSON.parse(fs.readFileSync(acornManifest, "utf8")).module
361
+ )
362
+ };
353
363
  await esbuild({
354
364
  entryPoints: [path.join(process.cwd(), entry)],
355
365
  bundle: true,
@@ -357,7 +367,8 @@ See --help for a list of available commands.`
357
367
  target: "esnext",
358
368
  format: "esm",
359
369
  outfile: path.join(process.cwd(), "dist", "index.js"),
360
- external: Object.keys(__spreadValues({}, peerDeps2))
370
+ external: Object.keys(__spreadValues({}, peerDeps2)),
371
+ alias
361
372
  });
362
373
  await esbuild({
363
374
  entryPoints: [path.join(process.cwd(), entry)],
@@ -369,7 +380,8 @@ See --help for a list of available commands.`
369
380
  // Bundle dependencies, the remark ecosystem only publishes ES modules
370
381
  // and includes "development" export maps which actually throw errors during
371
382
  // development, which we don't want to expose our users to.
372
- external: Object.keys(__spreadValues({}, peerDeps2))
383
+ external: Object.keys(__spreadValues({}, peerDeps2)),
384
+ alias
373
385
  });
374
386
  } else {
375
387
  await esbuild({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tinacms/scripts",
3
3
  "type": "module",
4
- "version": "1.6.3",
4
+ "version": "1.6.4",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "dist",