build: let webpack bundle dayjs

This commit is contained in:
Panagiotis Papadopoulos 2025-02-27 22:44:18 +01:00
parent 06a439e95d
commit 49a2eb0ccf
6 changed files with 3 additions and 9 deletions

View File

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

View File

@ -123,7 +123,6 @@ declare global {
language: string
});
};
var dayjs: {};
var Split: (selectors: string[], config: {
sizes: [ number, number ];
gutterSize: number;

View File

@ -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">

View File

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

View File

@ -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">

View File

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