Ensure that all import and require statements, in the entire code-base, have a .js file extension

In order to eventually get rid of SystemJS and start using native `import`s instead, we'll need to provide "complete" file identifiers since otherwise there'll be MIME type errors when attempting to use `import`.
This commit is contained in:
Jonas Jenwald 2020-01-02 12:00:16 +01:00
parent b833f84307
commit 36881e3770
125 changed files with 453 additions and 443 deletions

View file

@ -37,7 +37,7 @@ import {
UnknownErrorException,
unreachable,
warn,
} from "../shared/util";
} from "../shared/util.js";
import {
deprecated,
DOMCanvasFactory,
@ -47,16 +47,16 @@ import {
releaseImageResources,
RenderingCancelledException,
StatTimer,
} from "./display_utils";
import { FontFaceObject, FontLoader } from "./font_loader";
import { apiCompatibilityParams } from "./api_compatibility";
import { CanvasGraphics } from "./canvas";
import { GlobalWorkerOptions } from "./worker_options";
import { isNodeJS } from "../shared/is_node";
import { MessageHandler } from "../shared/message_handler";
import { Metadata } from "./metadata";
import { PDFDataTransportStream } from "./transport_stream";
import { WebGLContext } from "./webgl";
} from "./display_utils.js";
import { FontFaceObject, FontLoader } from "./font_loader.js";
import { apiCompatibilityParams } from "./api_compatibility.js";
import { CanvasGraphics } from "./canvas.js";
import { GlobalWorkerOptions } from "./worker_options.js";
import { isNodeJS } from "../shared/is_node.js";
import { MessageHandler } from "../shared/message_handler.js";
import { Metadata } from "./metadata.js";
import { PDFDataTransportStream } from "./transport_stream.js";
import { WebGLContext } from "./webgl.js";
const DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536
const RENDERING_CANCELLED_TIMEOUT = 100; // ms
@ -1635,7 +1635,7 @@ const PDFWorker = (function PDFWorkerClosure() {
if (typeof SystemJS !== "object") {
throw new Error("SystemJS must be used to load fake worker.");
}
const worker = await SystemJS.import("pdfjs/core/worker");
const worker = await SystemJS.import("pdfjs/core/worker.js");
return worker.WorkerMessageHandler;
}
if (