From 5afea744f16d8b9b77782c3d68e364fd6dce7efa Mon Sep 17 00:00:00 2001
From: Benedikt Seeger <benedikt.seeger@ptb.de>
Date: Fri, 28 Feb 2025 13:34:25 +0100
Subject: [PATCH] now using the bundled js instead of unbundled preparation for
 cdn delivery

---
 .gitignore                                      |  2 ++
 ...ple_dcc_WithExampleConformatyStatmentXLT.xml | 17 ++++++++++-------
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/.gitignore b/.gitignore
index 27caef2..af6ab7a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,5 @@ dcc-viewer/node_modules/
 node_modules/
 
 coverage/
+
+dist/
diff --git a/data/sin_acceleration_example_dcc_WithExampleConformatyStatmentXLT.xml b/data/sin_acceleration_example_dcc_WithExampleConformatyStatmentXLT.xml
index 12778ad..c4b2794 100644
--- a/data/sin_acceleration_example_dcc_WithExampleConformatyStatmentXLT.xml
+++ b/data/sin_acceleration_example_dcc_WithExampleConformatyStatmentXLT.xml
@@ -5,7 +5,7 @@
   xsi:schemaLocation="https://ptb.de/dcc https://gitlab1.ptb.de/digitaldynamicmeasurement/dccanddsischemawithoutdepricatedelements/-/raw/main/dcc.xsd"
   schemaVersion="3.3.0">
 
-    <!-- Embedded XSLT stylesheet -->
+  <!-- Embedded XSLT stylesheet for production -->
   <xsl:stylesheet id="embeddedXSL" version="1.0"
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       xmlns:exsl="http://exslt.org/common">
@@ -19,21 +19,24 @@
         <head>
           <meta charset="UTF-8"/>
           <title>DCC Viewer</title>
+          <!-- Link to production CSS -->
           <link rel="stylesheet" type="text/css" href="http://141.25.102.20:5173/dist/style.css"/>
         </head>
         <body>
           <div id="app"></div>
-          <!-- Output the entire XML into a hidden script block as plain text -->
+          <!-- Output the certificate XML into a hidden script block -->
           <script id="xmlContent" type="application/xml">
             <xsl:copy-of select="dcc:digitalCalibrationCertificate"/>
           </script>
           <!-- Load the production bundle and initialize the app -->
           <script type="module">
-            <![CDATA[import { init } from 'http://localhost:5173/src/app.js';
-const xmlNode = document.getElementById('xmlContent').firstChild;
-const xmlStr = new XMLSerializer().serializeToString(xmlNode);
-console.log('Serialized XML:', xmlStr);
-init(xmlStr, { containerId: 'app', language: 'en' });]]>
+            <![CDATA[
+              import { init } from 'http://141.25.102.20:5173/dist/dccviewer-js.es.js';
+              const xmlNode = document.getElementById('xmlContent').firstChild;
+              const xmlStr = new XMLSerializer().serializeToString(xmlNode);
+              console.log('Serialized XML:', xmlStr);
+              init(xmlStr, { containerId: 'app', language: 'en' });
+            ]]>
           </script>
         </body>
       </html>
-- 
GitLab