From 8d57df72564a9b2af43a859e5b70328748861b1c Mon Sep 17 00:00:00 2001 From: LouisLam Date: Tue, 17 Aug 2021 19:58:09 +0800 Subject: [PATCH] fix #226 a workaround fix similar to https://github.com/jvandemo/generator-angular2-library/issues/221#issuecomment-355945207 --- src/util.js | 3 ++- src/util.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util.js b/src/util.js index b1b7f7739..44eaebc69 100644 --- a/src/util.js +++ b/src/util.js @@ -1,7 +1,8 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TimeLogger = exports.polyfill = exports.debug = exports.ucfirst = exports.sleep = exports.flipStatus = exports.PENDING = exports.UP = exports.DOWN = exports.appName = exports.isDev = void 0; -const dayjs = require("dayjs"); +const _dayjs = require("dayjs"); +const dayjs = _dayjs; exports.isDev = process.env.NODE_ENV === "development"; exports.appName = "Uptime Kuma"; exports.DOWN = 0; diff --git a/src/util.ts b/src/util.ts index bb55ee08b..add9f1935 100644 --- a/src/util.ts +++ b/src/util.ts @@ -4,7 +4,8 @@ // Frontend uses util.ts // Need to run "tsc" to compile if there are any changes. -import * as dayjs from "dayjs"; +import * as _dayjs from "dayjs"; +const dayjs = _dayjs; export const isDev = process.env.NODE_ENV === "development"; export const appName = "Uptime Kuma";