mirror of
https://github.com/jzillmann/pdf-to-markdown.git
synced 2025-06-25 03:51:33 +02:00
Bundling in production
This commit is contained in:
parent
e2ed193967
commit
0c2ba48eb2
@ -4,7 +4,12 @@ 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 },
|
'node_modules/pdfjs-dist/es5/build/': { url: '/worker', static: true },
|
||||||
|
},
|
||||||
|
optimize: {
|
||||||
|
bundle: true,
|
||||||
|
minify: true,
|
||||||
|
target: 'es2020',
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
['@snowpack/plugin-build-script', { cmd: 'postcss', input: ['.css'], output: ['.css'] }],
|
['@snowpack/plugin-build-script', { cmd: 'postcss', input: ['.css'], output: ['.css'] }],
|
||||||
@ -21,7 +26,8 @@ module.exports = {
|
|||||||
port: 3005,
|
port: 3005,
|
||||||
},
|
},
|
||||||
buildOptions: {
|
buildOptions: {
|
||||||
/* ... */
|
baseUrl: '/pdf-to-markdown-staging/',
|
||||||
|
metaUrlPath: 'modules',
|
||||||
},
|
},
|
||||||
alias: {
|
alias: {
|
||||||
'@core': '../core/src/index.js',
|
'@core': '../core/src/index.js',
|
||||||
|
@ -9,12 +9,12 @@ import { Writable, writable } from 'svelte/store';
|
|||||||
export let debug: Writable<Debugger> = writable(undefined);
|
export let debug: Writable<Debugger> = writable(undefined);
|
||||||
export let parseResult: Writable<ParseResult> = writable(undefined);
|
export let parseResult: Writable<ParseResult> = writable(undefined);
|
||||||
|
|
||||||
pdfjs.GlobalWorkerOptions.workerSrc = 'worker/pdf.worker.min.js';
|
pdfjs.GlobalWorkerOptions.workerSrc = `worker/pdf.worker.min.js`;
|
||||||
|
|
||||||
const pdfPipeline = createPipeline(pdfjs, {});
|
const pdfPipeline = createPipeline(pdfjs, {});
|
||||||
|
|
||||||
export async function loadExample(progressListener: ProgressListenFunction): Promise<any> {
|
export async function loadExample(progressListener: ProgressListenFunction): Promise<any> {
|
||||||
return parsePdf('/ExamplePdf.pdf', progressListener);
|
return parsePdf('ExamplePdf.pdf', progressListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function processUpload(file: File, progressListener: ProgressListenFunction): Promise<any> {
|
export async function processUpload(file: File, progressListener: ProgressListenFunction): Promise<any> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user