INNER CODE UNIT · TypeScript

pathResolve

cloudflare/miniflare · packages/core/src/index.ts:191

const pathResolve = (p: string) => path.resolve(p);

function throwNoScriptError(modules?: boolean) {
  const execName = process.env.MINIFLARE_EXEC_NAME ?? "miniflare";
  const script = modules ? "worker.mjs" : "worker.js";
  const format = modules ? "modules" : "service-worker";
  const pkgScriptField = modules ? "module" : "main";
  const lines = [
    "No script defined, either:",
    "- Pass it as a positional argument, if you're using the CLI",
    dim(`    $ ${execName} dist/${script}`),
    "- Set the script or scriptPath option, if you're using the API",
    dim(`    new Miniflare({ scriptPath: "dist/${script}" })`),
    `- Set ${pkgScriptField} in package.json`,
    dim(`    { "${pkgScriptField}": "dist/${script}" }`),
  ];
  if (modules) {
    lines.push(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…