Skip to content

Build your personal knowledge base with Trilium Notes

build: let webpack bundle dayjs

Panagiotis Papadopoulos49a2eb0ccf4a
diff --git a/src/public/app/services/frontend_script_api.ts b/src/public/app/services/frontend_script_api.ts
index 178b0aa59c..86a793c9f8 100644
--- a/src/public/app/services/frontend_script_api.ts
+++ b/src/public/app/services/frontend_script_api.ts
@@ -17,6 +17,7 @@ import shortcutService from "./shortcuts.js";
import dialogService from "./dialog.js";
import type FNote from "../entities/fnote.js";
import { t } from "./i18n.js";
+import dayjs from "dayjs";
import type NoteContext from "../components/note_context.js";
import type NoteDetailWidget from "../widgets/note_detail.js";
import type Component from "../components/component.js";
@@ -84,7 +85,7 @@ interface Api {
* See {@link https://day.js.org} for documentation
* @see https://day.js.org
*/
- dayjs: typeof window.dayjs;
+ dayjs: typeof dayjs;
RightPanelWidget: typeof RightPanelWidget;
NoteContextAwareWidget: typeof NoteContextAwareWidget;
diff --git a/src/public/app/types.d.ts b/src/public/app/types.d.ts
index 1ef4296500..2a11f30e5c 100644
--- a/src/public/app/types.d.ts
+++ b/src/public/app/types.d.ts
@@ -123,7 +123,6 @@ declare global {
language: string
});
};
- var dayjs: {};
var Split: (selectors: string[], config: {
sizes: [ number, number ];
gutterSize: number;
diff --git a/src/public/app/widgets/watched_file_update_status.js b/src/public/app/widgets/watched_file_update_status.js
index 6f3ee4e3dc..d73746b86d 100644
--- a/src/public/app/widgets/watched_file_update_status.js
+++ b/src/public/app/widgets/watched_file_update_status.js
@@ -2,6 +2,7 @@ import { t } from "../services/i18n.js";
import NoteContextAwareWidget from "./note_context_aware_widget.js";
import server from "../services/server.js";
import fileWatcher from "../services/file_watcher.js";
+import dayjs from "dayjs";
const TPL = `
<div class="dropdown watched-file-update-status-widget alert alert-warning">
diff --git a/src/routes/assets.ts b/src/routes/assets.ts
index 4942f8017e..8c7f298eb7 100644
--- a/src/routes/assets.ts
+++ b/src/routes/assets.ts
@@ -61,8 +61,6 @@ async function register(app: express.Application) {
app.use(`/node_modules/katex/dist/`, express.static(path.join(srcRoot, "..", "node_modules/katex/dist/")));
app.use(`/${assetPath}/node_modules/katex/dist/`, persistentCacheStatic(path.join(srcRoot, "..", "node_modules/katex/dist/")));
- app.use(`/${assetPath}/node_modules/dayjs/`, persistentCacheStatic(path.join(srcRoot, "..", "node_modules/dayjs/")));
-
app.use(`/${assetPath}/node_modules/boxicons/css/`, persistentCacheStatic(path.join(srcRoot, "..", "node_modules/boxicons/css/")));
app.use(`/${assetPath}/node_modules/boxicons/fonts/`, persistentCacheStatic(path.join(srcRoot, "..", "node_modules/boxicons/fonts/")));
diff --git a/src/views/desktop.ejs b/src/views/desktop.ejs
index 5c624cf497..390e5fdf9f 100644
--- a/src/views/desktop.ejs
+++ b/src/views/desktop.ejs
@@ -44,9 +44,6 @@
<script src="<%= assetPath %>/node_modules/jquery-hotkeys/jquery-hotkeys.js"></script>
<script src="<%= assetPath %>/node_modules/autocomplete.js/dist/autocomplete.jquery.min.js"></script>
-
-<script src="<%= assetPath %>/node_modules/dayjs/dayjs.min.js"></script>
-
<script src="<%= assetPath %>/node_modules/split.js/dist/split.min.js"></script>
<link href="<%= assetPath %>/stylesheets/ckeditor-theme.css" rel="stylesheet">
diff --git a/src/views/mobile.ejs b/src/views/mobile.ejs
index 3660d0087c..c1a99ea863 100644
--- a/src/views/mobile.ejs
+++ b/src/views/mobile.ejs
@@ -115,8 +115,6 @@
<script src="<%= assetPath %>/node_modules/autocomplete.js/dist/autocomplete.jquery.min.js"></script>
-<script src="<%= assetPath %>/node_modules/dayjs/dayjs.min.js"></script>
-
<link href="<%= assetPath %>/stylesheets/tree.css" rel="stylesheet">
<script src="<%= assetPath %>/node_modules/jquery.fancytree/dist/jquery.fancytree-all-deps.min.js"></script>