fix require() actually not working after build in the frontend

This commit is contained in:
LouisLam
2021-07-17 00:51:28 +08:00
parent b3bff8d735
commit dfa9b3a0ca
4 changed files with 17 additions and 8 deletions

View File

@@ -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));