Moved code into src folder. Added build for component library.
This commit is contained in:
1 parent
7a7233ead4
commit
ede658771e
490 files changed
+749
-442
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { CURRENT_VERSION, TELEMETRY_PIXEL } from 'lib/constants';
|
||||
|
||||
export default function handler(req, res) {
|
||||
res.setHeader('content-type', 'text/javascript');
|
||||
|
||||
if (process.env.DISABLE_TELEMETRY) {
|
||||
return res.send('/* telemetry disabled */');
|
||||
}
|
||||
|
||||
const script = `
|
||||
(()=>{const i=document.createElement('img');
|
||||
i.setAttribute('src','${TELEMETRY_PIXEL}?v=${CURRENT_VERSION}');
|
||||
i.setAttribute('style','width:0;height:0;position:absolute;pointer-events:none;');
|
||||
document.body.appendChild(i);})();
|
||||
`;
|
||||
|
||||
return res.send(script.replace(/\s\s+/g, ''));
|
||||
}
|
||||
Reference in new issue
Block a user