-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathrollup.config.js
32 lines (30 loc) · 1.06 KB
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { nodeResolve } from '@rollup/plugin-node-resolve'
import terser from '@rollup/plugin-terser'
import { copy } from 'fs-extra'
const copyPDFJS = () => ({
name: 'copy-pdfjs',
async writeBundle() {
await copy('node_modules/pdfjs-dist/build/pdf.mjs', 'vendor/pdfjs/pdf.mjs')
await copy('node_modules/pdfjs-dist/build/pdf.mjs.map', 'vendor/pdfjs/pdf.mjs.map')
await copy('node_modules/pdfjs-dist/build/pdf.worker.mjs', 'vendor/pdfjs/pdf.worker.mjs')
await copy('node_modules/pdfjs-dist/build/pdf.worker.mjs.map', 'vendor/pdfjs/pdf.worker.mjs.map')
await copy('node_modules/pdfjs-dist/cmaps', 'vendor/pdfjs/cmaps')
await copy('node_modules/pdfjs-dist/standard_fonts', 'vendor/pdfjs/standard_fonts')
},
})
export default [{
input: 'rollup/fflate.js',
output: {
dir: 'vendor/',
format: 'esm',
},
plugins: [nodeResolve(), terser()],
},
{
input: 'rollup/zip.js',
output: {
dir: 'vendor/',
format: 'esm',
},
plugins: [nodeResolve(), terser(), copyPDFJS()],
}]