From 14be1efde0f9124d126790003aa4b23f325ea0e5 Mon Sep 17 00:00:00 2001 From: Xmader Date: Tue, 28 Apr 2020 02:46:21 -0400 Subject: [PATCH] fix for Greasemonkey --- rollup.config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 058a094..3f464ae 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -62,9 +62,8 @@ export default [ output: { file: "dist/cache/worker.js", format: "iife", - name: "Worker", banner: "export const PDFWorker = function () { ", - footer: "return Worker\n}\n", + footer: "}\n", sourcemap: false, }, plugins, @@ -76,7 +75,8 @@ export default [ format: "iife", sourcemap: false, 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: "// fix for Greasemonkey\nwindow.eval('(' + function () {", + outro: "}.toString() + ')()')" }, plugins, },