Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion @plotly/webpack-dash-dynamic-import/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
10 changes: 9 additions & 1 deletion @plotly/webpack-dash-dynamic-import/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down