mirror of
https://github.com/jzillmann/pdf-to-markdown.git
synced 2025-06-25 12:01:45 +02:00
Make worker functional in dev mode
This commit is contained in:
parent
ae6d47d329
commit
21ecfd35bd
@ -4,6 +4,7 @@ module.exports = {
|
|||||||
public: { url: '/', static: true },
|
public: { url: '/', static: true },
|
||||||
src: { url: '/dist' },
|
src: { url: '/dist' },
|
||||||
'../core/src': { url: '/core' },
|
'../core/src': { url: '/core' },
|
||||||
|
'node_modules/pdfjs-dist/build/': { url: '/worker', static: true },
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
['@snowpack/plugin-build-script', { cmd: 'postcss', input: ['.css'], output: ['.css'] }],
|
['@snowpack/plugin-build-script', { cmd: 'postcss', input: ['.css'], output: ['.css'] }],
|
||||||
|
@ -6,9 +6,7 @@ import { Writable, writable } from 'svelte/store';
|
|||||||
|
|
||||||
export let parseResult: Writable<ParseResult> = writable(undefined);
|
export let parseResult: Writable<ParseResult> = writable(undefined);
|
||||||
|
|
||||||
// TODO this will setup fake worker cause getMainThreadWorkerMessageHandler isn't null
|
pdfjs.GlobalWorkerOptions.workerSrc = 'worker/pdf.worker.min.js';
|
||||||
import pdfjsWorker from 'pdfjs-dist//es5/build/pdf.worker.entry';
|
|
||||||
pdfjs.GlobalWorkerOptions.workerSrc = pdfjsWorker;
|
|
||||||
|
|
||||||
const parser = pdfParser(pdfjs);
|
const parser = pdfParser(pdfjs);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user