Ensure pdf.js and the viewer are using the same versions.

This commit is contained in:
Joachim Bauch 2021-11-22 15:15:08 +01:00
parent f015947cca
commit 4e6009c530
No known key found for this signature in database
GPG key ID: 77C1D22D53E15F02

View file

@ -3,6 +3,13 @@ const path = require('path');
const CopyPlugin = require("copy-webpack-plugin");
const TerserPlugin = require('terser-webpack-plugin');
const package = require('./package.json');
const versionPdfJs = package.dependencies['pdfjs-dist'];
const versionPdfJsViewer = package.dependencies['pdfjs-dist-viewer-min'];
if (versionPdfJs !== versionPdfJsViewer) {
throw new Error('PDF.js (' + versionPdfJs + ') and the viewer (' + versionPdfJsViewer + ') must use the same versions.');
}
module.exports = {
entry: {
'loader': path.join(__dirname, 'src', 'loader.js'),