Fix about css
This commit is contained in:
@@ -66,9 +66,11 @@ function bumpVersion() {
|
||||
return Math.floor(Date.now() / 1000).toString(36);
|
||||
}
|
||||
|
||||
// Swap dev asset tags in HTML for bundle tags
|
||||
// Swap dev asset tags in HTML for bundle tags.
|
||||
// Strips the main sunscope.css link but preserves standalone CSS files
|
||||
// like about.css that are not part of the main bundle.
|
||||
function rewriteHTML(html, version) {
|
||||
html = html.replace(/<link\s[^>]*href=["'][^"']*assets\/[^"']*\.css[^"']*["'][^>]*>/gi, '');
|
||||
html = html.replace(/<link\s[^>]*href=["'][^"']*assets\/sunscope\.css[^"']*["'][^>]*>/gi, '');
|
||||
html = html.replace(/<script\s[^>]*src=["'][^"']*assets\/js\/[^"']*["'][^>]*><\/script>/gi, '');
|
||||
const css = ' <link rel="stylesheet" href="./assets/bundle.min.css?v=' + version + '">';
|
||||
const js = ' <script defer src="./assets/bundle.min.js?v=' + version + '"></script>';
|
||||
@@ -143,7 +145,16 @@ async function build() {
|
||||
console.log(' -> ' + htmlFile);
|
||||
}
|
||||
|
||||
// 5. Copy static files
|
||||
// 5. Copy standalone CSS files that are not part of the main bundle
|
||||
for (const f of ['about.css']) {
|
||||
const src = path.join(ROOT, 'assets', f);
|
||||
if (fs.existsSync(src)) {
|
||||
copyFile(src, path.join(ASSETS, f));
|
||||
console.log(' -> assets/' + f);
|
||||
}
|
||||
}
|
||||
|
||||
// 6. Copy static files
|
||||
console.log(' Copying static files...');
|
||||
for (const f of ['robots.txt', 'sitemap.xml', 'og-image.png']) {
|
||||
const src = path.join(ROOT, f);
|
||||
|
||||
Reference in New Issue
Block a user