From 1b690833299346f06c297df98de3cb827eba53c7 Mon Sep 17 00:00:00 2001 From: Nathanael Ruf Date: Mon, 23 Nov 2020 09:20:35 +0100 Subject: [PATCH] Workaround for missing window in web worker --- cytoscape-dagre.js | 2 +- webpack.config.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cytoscape-dagre.js b/cytoscape-dagre.js index b8537955..c0506dfd 100644 --- a/cytoscape-dagre.js +++ b/cytoscape-dagre.js @@ -7,7 +7,7 @@ exports["cytoscapeDagre"] = factory(require("dagre")); else root["cytoscapeDagre"] = factory(root["dagre"]); -})(window, function(__WEBPACK_EXTERNAL_MODULE__4__) { +})(this, function(__WEBPACK_EXTERNAL_MODULE__4__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; diff --git a/webpack.config.js b/webpack.config.js index 79bf7aec..b6fdd24e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -15,7 +15,8 @@ let config = { path: path.join( __dirname ), filename: pkg.name + '.js', library: camelcase( pkg.name ), - libraryTarget: 'umd' + libraryTarget: 'umd', + globalObject: "this" }, module: { rules: [