diff --git a/@plotly/webpack-dash-dynamic-import/package.json b/@plotly/webpack-dash-dynamic-import/package.json index 824fd5de02..b2504683b2 100644 --- a/@plotly/webpack-dash-dynamic-import/package.json +++ b/@plotly/webpack-dash-dynamic-import/package.json @@ -1,6 +1,6 @@ { "name": "@plotly/webpack-dash-dynamic-import", - "version": "1.1.4", + "version": "1.1.5", "description": "Webpack Plugin for Dynamic Import in Dash", "repository": { "type": "git", diff --git a/@plotly/webpack-dash-dynamic-import/src/index.js b/@plotly/webpack-dash-dynamic-import/src/index.js index 816c6d278f..ff7a14dad1 100644 --- a/@plotly/webpack-dash-dynamic-import/src/index.js +++ b/@plotly/webpack-dash-dynamic-import/src/index.js @@ -20,7 +20,15 @@ var getCurrentScript = function() { if (!script) { /* Shim for IE11 and below */ /* Do not take into account async scripts and inline scripts */ - var scripts = Array.from(document.getElementsByTagName('script')).filter(function(s) { return !s.async && !s.text && !s.textContent; }); + + var doc_scripts = document.getElementsByTagName('script'); + var scripts = []; + + for (var i = 0; i < doc_scripts.length; i++) { + scripts.push(doc_scripts[i]); + } + + scripts = scripts.filter(function(s) { return !s.async && !s.text && !s.textContent; }); script = scripts.slice(-1)[0]; }