@featurepeek/snippet.js
Advanced tools
Comparing version 0.2.6 to 0.2.7
@@ -1,1 +0,1 @@ | ||
!function(){var e,t=document;/^deploy-preview-/.test(t.location.hostname)&&((e=t.createElement("script")).src="https://unpkg.com/@featurepeek/snippet.js/dist/netlify.js",t.body.appendChild(e))}(); | ||
!function(){function e(e){return e.every(function(e){return e.test(location.hostname)})}function t(e){var t=document,n=t.createElement("script");n.src="https://unpkg.com/@featurepeek/snippet.js/dist/".concat(e,".js"),t.body.appendChild(n)}e([/--pr[\d]+-/,/\.web\.app$/])?t("firebase"):e([/--/,/\.netlify\.app$/])&&t("netlify")}(); |
{ | ||
"name": "@featurepeek/snippet.js", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"main": "dist/loader.js", | ||
@@ -22,3 +22,4 @@ "repository": "https://github.com/featurepeek/snippet.js", | ||
"scripts": { | ||
"build": "mkdir -p dist && yarn build:loader && yarn build:netlify && yarn build:vercel", | ||
"build": "mkdir -p dist && yarn build:loader && yarn build:firebase && yarn build:netlify && yarn build:vercel", | ||
"build:firebase": "babel src/firebase.js | uglifyjs --compress --mangle --output dist/firebase.js", | ||
"build:netlify": "babel src/netlify.js | uglifyjs --compress --mangle --output dist/netlify.js", | ||
@@ -25,0 +26,0 @@ "build:vercel": "babel src/vercel.js | uglifyjs --compress --mangle --output dist/vercel.js", |
;(() => { | ||
const d = document | ||
if (/^deploy-preview-/.test(d.location.hostname)) { | ||
// eslint-disable-next-line no-restricted-globals | ||
const regexesMatchHostname = regexes => regexes.every(r => r.test(location.hostname)) | ||
function appendScript(filename) { | ||
const d = document | ||
const script = d.createElement('script') | ||
script.src = 'https://unpkg.com/@featurepeek/snippet.js/dist/netlify.js' | ||
script.src = `https://unpkg.com/@featurepeek/snippet.js/dist/${filename}.js` | ||
d.body.appendChild(script) | ||
} | ||
if (regexesMatchHostname([/--pr[\d]+-/, /\.web\.app$/])) { | ||
appendScript('firebase') | ||
} else if (regexesMatchHostname([/--/, /\.netlify\.app$/])) { | ||
appendScript('netlify') | ||
} | ||
})() |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103590
14
1808