Added postbuild script.

This commit is contained in:
Mike Cao 2022-03-16 22:05:43 -07:00
parent 0d33e6d08f
commit a249f0c6dc
3 changed files with 13 additions and 6 deletions

View file

@ -1,4 +1,3 @@
require('dotenv').config();
const fs = require('fs-extra');
const path = require('path');
const os = require('os');
@ -9,7 +8,7 @@ const pkg = require('../package.json');
const dest = path.resolve(__dirname, '../.next/cache/umami.json');
const url = 'https://telemetry.umami.is/api/collect';
async function run() {
async function sendTelemetry() {
await fs.ensureFile(dest);
let json = {};
@ -52,6 +51,4 @@ async function run() {
}
}
if (!process.env.TELEMETRY_DISABLED) {
run();
}
module.exports = sendTelemetry;