From dfa9b3a0cad8adba9f2dd50e2e10d7701bc60e37 Mon Sep 17 00:00:00 2001 From: LouisLam Date: Sat, 17 Jul 2021 00:51:28 +0800 Subject: [PATCH] fix require() actually not working after build in the frontend --- server/util.js | 8 ++------ src/components/CountUp.vue | 2 +- src/components/NotificationDialog.vue | 2 +- src/util-frontend.js | 13 +++++++++++++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/server/util.js b/server/util.js index d1c9266a..0a8877b8 100644 --- a/server/util.js +++ b/server/util.js @@ -1,9 +1,5 @@ -/* - * Common functions - can be used in frontend or backend - */ - - - +// Common JS cannot be used in frontend sadly +// sleep, ucfirst is duplicated in ../src/util-frontend.js exports.sleep = function (ms) { return new Promise(resolve => setTimeout(resolve, ms)); diff --git a/src/components/CountUp.vue b/src/components/CountUp.vue index b90f430e..33904b6a 100644 --- a/src/components/CountUp.vue +++ b/src/components/CountUp.vue @@ -5,7 +5,7 @@