elegance-js 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/page_compiler.mjs
CHANGED
|
@@ -228,8 +228,8 @@ var generateHTMLTemplate = async ({
|
|
|
228
228
|
StartTemplate += `<script data-module="true" src="/shipped/${globalName}.js" defer="true"></script>`;
|
|
229
229
|
}
|
|
230
230
|
if (addPageScriptTag === true) {
|
|
231
|
-
const sanitized = pageURL === "" ? "/" : pageURL
|
|
232
|
-
StartTemplate += `<script data-page="true" type="module" data-pathname="${sanitized}" src="${sanitized}
|
|
231
|
+
const sanitized = pageURL === "" ? "/" : `/${pageURL}`;
|
|
232
|
+
StartTemplate += `<script data-page="true" type="module" data-pathname="${sanitized}" src="${sanitized}/${name}_data.js" defer="true"></script>`;
|
|
233
233
|
}
|
|
234
234
|
StartTemplate += `<script type="module" src="/client.js" defer="true"></script>`;
|
|
235
235
|
let builtHead;
|
|
@@ -955,7 +955,7 @@ var pageToHTML = async (pageLocation, pageElements, metadata, DIST_DIR2, pageNam
|
|
|
955
955
|
"pd",
|
|
956
956
|
false
|
|
957
957
|
);
|
|
958
|
-
const sanitized = pathname === "" ? "/" : pathname
|
|
958
|
+
const sanitized = pathname === "" ? "/" : `/${pathname}`;
|
|
959
959
|
extraBodyHTML = `<script data-hook="true" data-pathname="${sanitized}" type="text/plain">${result}</script>`;
|
|
960
960
|
extraBodyHTML += `<script>
|
|
961
961
|
const text = document.querySelector('[data-hook="true"][data-pathname="${sanitized}"][type="text/plain"').textContent;
|
|
@@ -209,8 +209,8 @@ var generateHTMLTemplate = async ({
|
|
|
209
209
|
StartTemplate += `<script data-module="true" src="/shipped/${globalName}.js" defer="true"></script>`;
|
|
210
210
|
}
|
|
211
211
|
if (addPageScriptTag === true) {
|
|
212
|
-
const sanitized = pageURL === "" ? "/" : pageURL
|
|
213
|
-
StartTemplate += `<script data-page="true" type="module" data-pathname="${sanitized}" src="${sanitized}
|
|
212
|
+
const sanitized = pageURL === "" ? "/" : `/${pageURL}`;
|
|
213
|
+
StartTemplate += `<script data-page="true" type="module" data-pathname="${sanitized}" src="${sanitized}/${name}_data.js" defer="true"></script>`;
|
|
214
214
|
}
|
|
215
215
|
StartTemplate += `<script type="module" src="/client.js" defer="true"></script>`;
|
|
216
216
|
let builtHead;
|
package/dist/server/server.mjs
CHANGED
|
@@ -271,8 +271,8 @@ var generateHTMLTemplate = async ({
|
|
|
271
271
|
StartTemplate += `<script data-module="true" src="/shipped/${globalName}.js" defer="true"></script>`;
|
|
272
272
|
}
|
|
273
273
|
if (addPageScriptTag === true) {
|
|
274
|
-
const sanitized = pageURL === "" ? "/" : pageURL
|
|
275
|
-
StartTemplate += `<script data-page="true" type="module" data-pathname="${sanitized}" src="${sanitized}
|
|
274
|
+
const sanitized = pageURL === "" ? "/" : `/${pageURL}`;
|
|
275
|
+
StartTemplate += `<script data-page="true" type="module" data-pathname="${sanitized}" src="${sanitized}/${name}_data.js" defer="true"></script>`;
|
|
276
276
|
}
|
|
277
277
|
StartTemplate += `<script type="module" src="/client.js" defer="true"></script>`;
|
|
278
278
|
let builtHead;
|
|
@@ -594,7 +594,7 @@ var pageToHTML = async (pageLocation, pageElements, metadata, DIST_DIR2, pageNam
|
|
|
594
594
|
"pd",
|
|
595
595
|
false
|
|
596
596
|
);
|
|
597
|
-
const sanitized = pathname === "" ? "/" : pathname
|
|
597
|
+
const sanitized = pathname === "" ? "/" : `/${pathname}`;
|
|
598
598
|
extraBodyHTML = `<script data-hook="true" data-pathname="${sanitized}" type="text/plain">${result}</script>`;
|
|
599
599
|
extraBodyHTML += `<script>
|
|
600
600
|
const text = document.querySelector('[data-hook="true"][data-pathname="${sanitized}"][type="text/plain"').textContent;
|