elegance-js 2.1.18 → 2.1.19
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.
|
@@ -53,18 +53,17 @@ async function buildClient(DIST_DIR2) {
|
|
|
53
53
|
clientString += `const watchServerPort = ${options.hotReload.port};`;
|
|
54
54
|
clientString += fs.readFileSync(watcherPath, "utf-8");
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
await esbuild.build({
|
|
57
57
|
minify: options.environment === "production",
|
|
58
58
|
drop: options.environment === "production" ? ["console", "debugger"] : void 0,
|
|
59
59
|
keepNames: false,
|
|
60
|
+
bundle: true,
|
|
60
61
|
format: "iife",
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
entryPoints: [clientPath],
|
|
63
|
+
platform: "browser",
|
|
64
|
+
outfile: path.join(DIST_DIR2, "/client.js"),
|
|
65
|
+
loader: { ".ts": "ts" }
|
|
63
66
|
});
|
|
64
|
-
fs.writeFileSync(
|
|
65
|
-
path.join(DIST_DIR2, "/client.js"),
|
|
66
|
-
transformedClient.code
|
|
67
|
-
);
|
|
68
67
|
}
|
|
69
68
|
;
|
|
70
69
|
function processOptionAsObjectAttribute(element, optionName, optionValue, objectAttributes) {
|
|
@@ -511,7 +510,9 @@ async function buildLayout(filePath, directory, generateDynamic = false) {
|
|
|
511
510
|
const { pageContentHTML, metadataHTML } = result;
|
|
512
511
|
function splitAround(str, sub) {
|
|
513
512
|
const i = str.indexOf(sub);
|
|
514
|
-
if (i === -1)
|
|
513
|
+
if (i === -1) {
|
|
514
|
+
throw new Error(`Whilst layout ${directory}, the splitter could not be found. Make sure to use the "child" prop passed into the layout.`);
|
|
515
|
+
}
|
|
515
516
|
return {
|
|
516
517
|
startHTML: str.substring(0, i),
|
|
517
518
|
endHTML: str.substring(i + sub.length)
|
|
@@ -519,7 +520,9 @@ async function buildLayout(filePath, directory, generateDynamic = false) {
|
|
|
519
520
|
}
|
|
520
521
|
function splitAt(str, sub) {
|
|
521
522
|
const i = str.indexOf(sub) + sub.length;
|
|
522
|
-
if (i === -1)
|
|
523
|
+
if (i === -1) {
|
|
524
|
+
throw new Error(`Whilst layout ${directory}, the splitter could not be found. Make sure to use the "child" prop passed into the layout's head.`);
|
|
525
|
+
}
|
|
523
526
|
return {
|
|
524
527
|
startHTML: str.substring(0, i),
|
|
525
528
|
endHTML: str.substring(i)
|