Made eslint using 'browser' environment and added globals, because RainLoop is used in browsers.

This also allowed to remove all webpack 'externals' overhead.
This commit is contained in:
djmaze 2020-08-12 00:25:36 +02:00
parent c3a213802d
commit e7180a86ce
81 changed files with 1857 additions and 1259 deletions

View file

@ -1,4 +1,3 @@
import window from 'window';
// let rainloopCaches = window.caches && window.caches.open ? window.caches : null;
@ -12,9 +11,8 @@ export function jassl(src, async = false) {
throw new Error('src should not be empty.');
}
return new window.Promise((resolve, reject) => {
const doc = window.document,
element = doc.createElement('script');
return new Promise((resolve, reject) => {
const element = document.createElement('script');
element.onload = () => {
resolve(src);
@ -27,7 +25,7 @@ export function jassl(src, async = false) {
element.async = !!async;
element.src = src;
doc.body.appendChild(element);
document.body.appendChild(element);
}) /* .then((s) => {
const found = s && rainloopCaches ? s.match(/rainloop\/v\/([^\/]+)\/static\//) : null;