@soleil-se/build-app 2.3.0 → 2.3.1
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/CHANGELOG.md +4 -0
- package/package.json +2 -2
- package/utils/files.js +12 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,10 @@ title: Changelog
|
|
|
4
4
|
|
|
5
5
|
Baseras på [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) och använder [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [2.3.1] - 2025-05-26
|
|
8
|
+
|
|
9
|
+
- Ta bort hydration markers för en app som renderas på servern, då det inte är nödvändigt.
|
|
10
|
+
|
|
7
11
|
## [2.3.0] - 2025-04-16
|
|
8
12
|
|
|
9
13
|
- Lägg till nytt argument för att kunna ange yttertligare sökväg för watchern, `--append-watch-path`.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soleil-se/build-app",
|
|
3
3
|
"description": "Script for building WebApps, RESTApps and Widgets with Svelte in Sitevision.",
|
|
4
|
-
"version": "2.3.
|
|
4
|
+
"version": "2.3.1",
|
|
5
5
|
"bin": {
|
|
6
6
|
"build-app": "./bin/index.js",
|
|
7
7
|
"sv-app-build": "./bin/index.js"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"slash": "5.1.0",
|
|
54
54
|
"svelte-preprocess": "6.0.3",
|
|
55
55
|
"@soleil-se/build-config": "^1.3.0",
|
|
56
|
-
"@soleil-se/build-utils": "^1.8.
|
|
56
|
+
"@soleil-se/build-utils": "^1.8.3"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"svelte": "^5.6.2"
|
package/utils/files.js
CHANGED
|
@@ -6,9 +6,21 @@ const indexContent = `(function() {
|
|
|
6
6
|
router.get('/', function() {});
|
|
7
7
|
}());`;
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Remove Svelte 5 hydration markers (<!---->, <!--]-->, <!--[-->) from the source file when they
|
|
11
|
+
* aren't needed, for example in SSR.
|
|
12
|
+
* @param {string} src - The path to the source file.
|
|
13
|
+
* @returns {Promise<void>}
|
|
14
|
+
*/
|
|
15
|
+
async function removeHydrationMarkers(src) {
|
|
16
|
+
const content = await fse.readFile(src);
|
|
17
|
+
await fse.writeFile(src, content.toString().replace(/(\\x3c!----\\x3e|\\x3c!--\[--\\x3e|\\x3c!--]--\\x3e)/gm, ''));
|
|
18
|
+
}
|
|
19
|
+
|
|
9
20
|
async function createMain(dest) {
|
|
10
21
|
const src = `${dest}/src/main.js`;
|
|
11
22
|
if (!fse.existsSync(src)) {
|
|
23
|
+
await removeHydrationMarkers(`${dest}/src/index.js`);
|
|
12
24
|
await fse.writeFile(src, '');
|
|
13
25
|
}
|
|
14
26
|
}
|