[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Vite: rewrite Moment external require for browser builds

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a8f14f717588_3818d9cc67641@gitlab-sidekiq-low-urgency-cpu-bound-v2-65ff88dfd7-dkwsm.mail>

Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
46a45323 by MAGENE Sem Joel at 2026-08-26T16:15:48+00:00
[FIX] Vite: rewrite Moment external require for browser builds
---
* [FIX] Vite: rewrite Moment external require for browser builds

See merge request tikiwiki/tiki!11043

- - - - -


1 changed file:

- src/js/vite.config.mjs


Changes:

=====================================
src/js/vite.config.mjs
=====================================
@@ -1,4 +1,4 @@
-import { defineConfig } from "vite";
+import { defineConfig, esmExternalRequirePlugin } from "vite";
 import vue from "@vitejs/plugin-vue";
 import { resolve } from "path";
 import { visualizer } from "rollup-plugin-visualizer";
@@ -217,7 +217,6 @@ export default defineConfig(({ command, mode }) => {
                     "jquery-ui",
                     "jquery-validation",
                     "mermaid",
-                    "moment",
                     /^moment\/.+/, //Moment submodules
                     "pivottablejs",
                     "plyr",
@@ -271,6 +270,11 @@ export default defineConfig(({ command, mode }) => {
             },
         },
         plugins: [
+            // Own this external here to rewrite moment-timezone's require("moment") for browsers.
+            // https://rolldown.rs/builtin-plugins/esm-external-require
+            esmExternalRequirePlugin({
+                external: ["moment"],
+            }),
             vue({
                 template: {
                     transformAssetUrls: {



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/46a45323bd863887446822841b36fa084e6ce3e1

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/46a45323bd863887446822841b36fa084e6ce3e1
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.