Skip to content

Commit

Permalink
Merge pull request #107 from LibreSign/fix/workersrc-path
Browse files Browse the repository at this point in the history
fix: workerSrc path
  • Loading branch information
vitormattos authored Oct 29, 2024
2 parents e56f6b3 + 88397a6 commit 6bd38b8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 2 additions & 4 deletions src/utils/asyncReader.js
Original file line number Diff line number Diff line change
@@ -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

/**
*
Expand Down
13 changes: 8 additions & 5 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 6bd38b8

Please sign in to comment.