fix: rollbar template needs PUBLIC_URL defined (#1127)

This commit is contained in:
Danny Brown 2019-10-29 16:04:53 -04:00 committed by GitHub
parent 1b5a5a2963
commit 352407c71a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 35 deletions

View File

@ -1,6 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
@ -44,8 +43,10 @@
<!-- Built with: https://polyfill.io/v3/url-builder/ --> <!-- Built with: https://polyfill.io/v3/url-builder/ -->
<!-- Targets IE11 --> <!-- Targets IE11 -->
<script <script src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CObject.values%2CArray.prototype.flat%2CObject.entries%2CSymbol%2CArray.prototype.includes%2CString.prototype.repeat%2CArray.prototype.find"></script>
src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CObject.values%2CArray.prototype.flat%2CObject.entries%2CSymbol%2CArray.prototype.includes%2CString.prototype.repeat%2CArray.prototype.find"></script> <script type="text/javascript">
window.PUBLIC_URL = '<%= PUBLIC_URL %>';
</script>
<script type="text/javascript" src="<%= PUBLIC_URL %>app-config.js"></script> <script type="text/javascript" src="<%= PUBLIC_URL %>app-config.js"></script>
<script type="module" src="<%= PUBLIC_URL %>init-service-worker.js"></script> <script type="module" src="<%= PUBLIC_URL %>init-service-worker.js"></script>
@ -61,7 +62,6 @@
window.config.extensions = [SomeExtension]; window.config.extensions = [SomeExtension];
</script> --> </script> -->
</head> </head>
<body> <body>
<noscript> You need to enable JavaScript to run this app. </noscript> <noscript> You need to enable JavaScript to run this app. </noscript>

View File

@ -10,7 +10,7 @@ var isNotLocalDevelopment =
['localhost', '127'].indexOf(location.hostname) === -1; ['localhost', '127'].indexOf(location.hostname) === -1;
if (supportsServiceWorker && isNotLocalDevelopment) { if (supportsServiceWorker && isNotLocalDevelopment) {
const swFileLocation = window.PUBLIC_URL + 'sw.js'; const swFileLocation = (window.PUBLIC_URL || '/') + 'sw.js';
const wb = new Workbox(swFileLocation); const wb = new Workbox(swFileLocation);
// Add an event listener to detect when the registered // Add an event listener to detect when the registered