@yannosay/sinth 0.0.16 → 0.0.18
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/package.json +1 -1
- package/src/sinth.ts +22 -14
package/package.json
CHANGED
package/src/sinth.ts
CHANGED
|
@@ -1591,15 +1591,15 @@ function compileFile(filePath: string, opts: CompileOptions): string | null {
|
|
|
1591
1591
|
return rel.startsWith(".") ? rel : "./" + rel;
|
|
1592
1592
|
});
|
|
1593
1593
|
|
|
1594
|
-
// Convert JS absolute paths to relative paths from the HTML output
|
|
1595
|
-
const relativeJsLinks = jsLinks.map(js => ({
|
|
1596
|
-
...js,
|
|
1597
|
-
src: (() => {
|
|
1598
|
-
const rel = path.relative(path.dirname(absPath), js.src).replace(/\\/g, "/");
|
|
1599
|
-
return rel.startsWith(".") ? rel : "./" + rel;
|
|
1600
|
-
})(),
|
|
1601
|
-
}));
|
|
1602
|
-
|
|
1594
|
+
// Convert JS absolute paths to relative paths from the HTML output
|
|
1595
|
+
const relativeJsLinks = jsLinks.map(js => ({
|
|
1596
|
+
...js,
|
|
1597
|
+
src: (() => {
|
|
1598
|
+
const rel = path.relative(path.dirname(absPath), js.src).replace(/\\/g, "/");
|
|
1599
|
+
return rel.startsWith(".") ? rel : "./" + rel;
|
|
1600
|
+
})(),
|
|
1601
|
+
}));
|
|
1602
|
+
|
|
1603
1603
|
const head = renderHead(headData, relativeCssLinks, relativeJsLinks, scopedCSS, companionJS);
|
|
1604
1604
|
const scriptTags: string[] = [];
|
|
1605
1605
|
|
|
@@ -1872,7 +1872,7 @@ async function main(): Promise<void> {
|
|
|
1872
1872
|
}
|
|
1873
1873
|
}
|
|
1874
1874
|
|
|
1875
|
-
// === v0.0.
|
|
1875
|
+
// === v0.0.18: Copy assets/ to outDir/assets/ ===
|
|
1876
1876
|
const assetsIn = path.join(cwd, "assets");
|
|
1877
1877
|
const assetsOut = path.join(outDir, "assets");
|
|
1878
1878
|
if (fs.existsSync(assetsIn)) {
|
|
@@ -1880,10 +1880,18 @@ async function main(): Promise<void> {
|
|
|
1880
1880
|
process.stdout.write(` \x1b[32m✓\x1b[0m assets/ → ${path.relative(cwd, assetsOut)}/\n`);
|
|
1881
1881
|
}
|
|
1882
1882
|
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1883
|
+
const libIn = path.join(cwd, "libraries");
|
|
1884
|
+
const libOut = path.join(outDir, "libraries");
|
|
1885
|
+
if (fs.existsSync(libIn)) {
|
|
1886
|
+
copyDir(libIn, libOut);
|
|
1887
|
+
const cleanFiles = fs.readdirSync(libOut, { recursive: true }) as string[];
|
|
1888
|
+
for (const f of cleanFiles) {
|
|
1889
|
+
if (f.endsWith(".sinth") || f.endsWith(".html")) {
|
|
1890
|
+
fs.unlinkSync(path.join(libOut, f));
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
process.stdout.write(` \x1b[32m✓\x1b[0m libraries/ → ${path.relative(cwd, libOut)}/\n`);
|
|
1894
|
+
}
|
|
1887
1895
|
|
|
1888
1896
|
case "dev": {
|
|
1889
1897
|
const fileArgs = cleanArgs.filter(a => a.endsWith(".sinth"));
|