diff --git a/package.json b/package.json index 214dbba..d3eaf66 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@libresign/vue-pdf-editor", "description": "vue2 pdf editor component", - "version": "1.3.6", + "version": "1.3.7", "author": "LibreCode", "private": false, "main": "dist/vue-pdf-editor.umd.js", diff --git a/src/utils/asyncReader.js b/src/utils/asyncReader.js index a60cd19..6dd26b4 100644 --- a/src/utils/asyncReader.js +++ b/src/utils/asyncReader.js @@ -1,9 +1,7 @@ import { getDocument, GlobalWorkerOptions } from 'pdfjs-dist' -import pdfWorkerCode from 'pdfjs-dist/legacy/build/pdf.worker.min.mjs' +import pdfWorkerCode from 'pdfjs-dist/build/pdf.worker.min.mjs' -if (!GlobalWorkerOptions.workerSrc) { - GlobalWorkerOptions.workerSrc = pdfWorkerCode -} +GlobalWorkerOptions.workerSrc = pdfWorkerCode /** * diff --git a/vue.config.js b/vue.config.js index 525a1c1..a840062 100644 --- a/vue.config.js +++ b/vue.config.js @@ -29,11 +29,14 @@ module.exports = defineConfig({ transpileDependencies: true, configureWebpack:{ module: { - rules: [ - { - test: /pdf\.worker(\.min)?\.mjs$/, - type: 'asset/resource' - }, + rules: [ + { + test: /pdf\.worker(\.min)?\.mjs$/, + type: 'asset/resource', + generator: { + filename: '[name][ext]', + }, + }, { test:/\.js$/, loader: 'babel-loader'