Multi-thread support for applyTemplate
This commit is contained in:
parent
f7e84e3ee7
commit
bfb07c633d
10 changed files with 1260 additions and 154 deletions
29
scripts/build-worker.mjs
Normal file
29
scripts/build-worker.mjs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { build } from 'esbuild';
|
||||
import path from 'node:path';
|
||||
import fs from 'node:fs';
|
||||
|
||||
const root = process.cwd();
|
||||
|
||||
const outputDir = path.join(root, 'workers/dist');
|
||||
|
||||
fs.mkdirSync(outputDir, { recursive: true });
|
||||
|
||||
await build({
|
||||
entryPoints: [
|
||||
path.join(root, 'workers/docx.worker.ts')
|
||||
],
|
||||
outfile: path.join(outputDir, 'docx.worker.mjs'),
|
||||
|
||||
bundle: true,
|
||||
platform: 'node',
|
||||
format: 'esm',
|
||||
packages: 'external',
|
||||
|
||||
alias: {
|
||||
'@': root
|
||||
},
|
||||
|
||||
sourcemap: false
|
||||
});
|
||||
|
||||
console.log('DOCX Worker compiled successfully');
|
||||
Loading…
Add table
Add a link
Reference in a new issue