5
0
mirror of git://git.proxmox.com/git/novnc-pve.git synced 2024-12-22 17:34:20 +03:00

transpile javascript before packaging

instead of using the babel-shim (which is not production-ready),
create a bundle app.js file with node-es6-module-transpiler in the
dh_auto_build step

this way, we only need to ship 1 js file instead of many

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2017-05-22 16:58:14 +02:00 committed by Wolfgang Bumiller
parent 4d91357934
commit 1e63d71311
6 changed files with 59 additions and 9 deletions

View File

@ -17,7 +17,7 @@ deb: ${DEB}
${DEB}: | submodule
rm -rf ${SRCDIR}.tmp
cp -rpa ${SRCDIR} ${SRCDIR}.tmp
cp -a debian ${SRCDIR}.tmp/debian
cp -a debian ${SRCDIR}.tmp/
echo "git clone git://git.proxmox.com/git/novnc-pve.git\\ngit checkout ${GITVERSION}" > ${SRCDIR}.tmp/debian/SOURCE
cd ${SRCDIR}.tmp; dpkg-buildpackage -rfakeroot -b -uc -us
lintian ${DEB}

2
debian/control vendored
View File

@ -2,7 +2,7 @@ Source: novnc-pve
Section: web
Priority: optional
Maintainer: Proxmox Support Team <support@proxmox.com>
Build-Depends: debhelper (>= 7.0.0~), quilt
Build-Depends: debhelper (>= 7.0.0~), quilt, node-es6-module-transpiler
Standards-Version: 3.8.3
Homepage: https://github.com/kanaka/noVNC/

11
debian/install vendored
View File

@ -1,7 +1,8 @@
app usr/share/novnc-pve
core usr/share/novnc-pve
app/images usr/share/novnc-pve/app
app/locale usr/share/novnc-pve/app
app/sounds usr/share/novnc-pve/app
app/styles usr/share/novnc-pve/app
app/error-handler.js usr/share/novnc-pve/app
app.js usr/share/novnc-pve
docs usr/share/novnc-pve
po usr/share/novnc-pve
utils usr/share/novnc-pve
vendor usr/share/novnc-pve
index.html.tpl usr/share/novnc-pve

View File

@ -0,0 +1,44 @@
From 6d3945c7c0b680a871d789215659f04e42acd6e7 Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com>
Date: Tue, 16 May 2017 10:36:15 +0200
Subject: [PATCH 10/10] use only app.js
because we will use the commonjs version,
we only need to use the generated app.js
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
vnc.html | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/vnc.html b/vnc.html
index ff70e0c..40c726b 100644
--- a/vnc.html
+++ b/vnc.html
@@ -46,22 +46,7 @@
</script>
<!-- begin scripts -->
- <!-- promise polyfills promises for IE11 -->
- <script src="/novnc/vendor/promise.js"></script>
- <!-- ES2015/ES6 modules polyfill -->
- <script type="module">
- window._noVNC_has_module_support = true;
- </script>
- <script>
- window.addEventListener("load", function() {
- if (window._noVNC_has_module_support) return;
- var loader = document.createElement("script");
- loader.src = "/novnc/vendor/browser-es-module-loader/dist/browser-es-module-loader.js";
- document.head.appendChild(loader);
- });
- </script>
- <!-- actual script modules -->
- <script type="module" src="/novnc/app/ui.js"></script>
+ <script src="/novnc/app.js"></script>
<!-- end scripts -->
</head>
--
2.11.0

View File

@ -7,3 +7,4 @@
0007-add-replaceable-snippets-in-vnc.html.patch
0008-focus-canvas-after-load.patch
0009-decrease-animation-time.patch
0010-use-only-app.js.patch

4
debian/rules vendored
View File

@ -5,6 +5,10 @@
export DEB_BUILD_HARDENING=1
override_dh_auto_build:
compile-modules convert -f bundle app/ui.js > app.js
dh_auto_build
override_dh_install:
cp vnc.html index.html.tpl
dh_install