include worker
This commit is contained in:
parent
6ba6136c23
commit
3b038bf2e1
2 changed files with 4 additions and 12 deletions
|
@ -21,7 +21,6 @@
|
||||||
"@types/pdfkit": "^0.10.4",
|
"@types/pdfkit": "^0.10.4",
|
||||||
"rollup": "^1.26.3",
|
"rollup": "^1.26.3",
|
||||||
"rollup-plugin-commonjs": "^10.1.0",
|
"rollup-plugin-commonjs": "^10.1.0",
|
||||||
"rollup-plugin-multi-entry": "^2.1.0",
|
|
||||||
"rollup-plugin-node-builtins": "^2.1.2",
|
"rollup-plugin-node-builtins": "^2.1.2",
|
||||||
"rollup-plugin-node-globals": "^1.4.0",
|
"rollup-plugin-node-globals": "^1.4.0",
|
||||||
"rollup-plugin-node-resolve": "^5.2.0",
|
"rollup-plugin-node-resolve": "^5.2.0",
|
||||||
|
|
|
@ -5,7 +5,6 @@ import builtins from "rollup-plugin-node-builtins"
|
||||||
import nodeGlobals from "rollup-plugin-node-globals"
|
import nodeGlobals from "rollup-plugin-node-globals"
|
||||||
import json from "@rollup/plugin-json"
|
import json from "@rollup/plugin-json"
|
||||||
import fs from "fs"
|
import fs from "fs"
|
||||||
import multiEntry from "rollup-plugin-multi-entry"
|
|
||||||
|
|
||||||
const getBannerText = () => {
|
const getBannerText = () => {
|
||||||
const packageJson = JSON.parse(fs.readFileSync("./package.json", "utf-8"))
|
const packageJson = JSON.parse(fs.readFileSync("./package.json", "utf-8"))
|
||||||
|
@ -64,17 +63,14 @@ export default [
|
||||||
file: "dist/cache/worker.js",
|
file: "dist/cache/worker.js",
|
||||||
format: "iife",
|
format: "iife",
|
||||||
name: "Worker",
|
name: "Worker",
|
||||||
banner: "var PDFWorker = function () { ",
|
banner: "export const PDFWorker = function () { ",
|
||||||
footer: "return Worker\n}",
|
footer: "return Worker\n}\n",
|
||||||
sourcemap: false,
|
sourcemap: false,
|
||||||
},
|
},
|
||||||
plugins,
|
plugins,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: [
|
input: "src/main.ts",
|
||||||
"dist/cache/worker.js",
|
|
||||||
"src/main.ts",
|
|
||||||
],
|
|
||||||
output: {
|
output: {
|
||||||
file: "dist/main.js",
|
file: "dist/main.js",
|
||||||
format: "iife",
|
format: "iife",
|
||||||
|
@ -82,9 +78,6 @@ export default [
|
||||||
banner: getBannerText,
|
banner: getBannerText,
|
||||||
// intro: "const global = typeof window === 'object' && window.window === window ? window : typeof self === 'object' && self.self === self ? self : typeof commonjsGlobal === 'object' && commonjsGlobal.global === commonjsGlobal ? commonjsGlobal : void 0"
|
// intro: "const global = typeof window === 'object' && window.window === window ? window : typeof self === 'object' && self.self === self ? self : typeof commonjsGlobal === 'object' && commonjsGlobal.global === commonjsGlobal ? commonjsGlobal : void 0"
|
||||||
},
|
},
|
||||||
plugins:[
|
plugins,
|
||||||
...plugins,
|
|
||||||
multiEntry({ exports: false }),
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue