@plotly/webpack-dash-dynamic-import
Advanced tools
Comparing version
{ | ||
"name": "@plotly/webpack-dash-dynamic-import", | ||
"version": "1.1.2", | ||
"version": "1.1.3-rc1", | ||
"description": "Webpack Plugin for Dynamic Import in Dash", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -13,9 +13,13 @@ const fs = require('fs'); | ||
/** | ||
* This code is injected as-is in the webpack artifact and must be ES5 compatible to work in all scenarios. | ||
* This will not get transpiled. | ||
*/ | ||
const resolveImportSource = () => `\ | ||
const getCurrentScript = function() { | ||
let script = document.currentScript; | ||
var getCurrentScript = function() { | ||
var script = document.currentScript; | ||
if (!script) { | ||
/* Shim for IE11 and below */ | ||
/* Do not take into account async scripts and inline scripts */ | ||
const scripts = Array.from(document.getElementsByTagName('script')).filter(function(s) { return !s.async && !s.text && !s.textContent; }); | ||
var scripts = Array.from(document.getElementsByTagName('script')).filter(function(s) { return !s.async && !s.text && !s.textContent; }); | ||
script = scripts.slice(-1)[0]; | ||
@@ -27,3 +31,3 @@ } | ||
const isLocalScript = function(script) { | ||
var isLocalScript = function(script) { | ||
return /\\\/_dash-component-suites\\\//.test(script.src); | ||
@@ -34,3 +38,3 @@ }; | ||
get: (function () { | ||
let script = getCurrentScript(); | ||
var script = getCurrentScript(); | ||
@@ -45,8 +49,8 @@ var url = script.src.split('/').slice(0, -1).join('/') + '/'; | ||
const __jsonpScriptSrc__ = jsonpScriptSrc; | ||
var __jsonpScriptSrc__ = jsonpScriptSrc; | ||
jsonpScriptSrc = function(chunkId) { | ||
let script = getCurrentScript(); | ||
let isLocal = isLocalScript(script); | ||
var script = getCurrentScript(); | ||
var isLocal = isLocalScript(script); | ||
let src = __jsonpScriptSrc__(chunkId); | ||
var src = __jsonpScriptSrc__(chunkId); | ||
@@ -57,4 +61,4 @@ if(!isLocal) { | ||
const srcFragments = src.split('/'); | ||
const fileFragments = srcFragments.slice(-1)[0].split('.'); | ||
var srcFragments = src.split('/'); | ||
var fileFragments = srcFragments.slice(-1)[0].split('.'); | ||
@@ -61,0 +65,0 @@ fileFragments.splice(1, 0, ${getFingerprint()}); |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
7966
120.79%4
33.33%63
6.78%1
Infinity%