Serve static assets from a CDN host if provided

This commit is contained in:
Jaz Volpert
2024-10-04 13:40:45 -07:00
parent 6382fe4535
commit b0fe2c6c9a
3 changed files with 37 additions and 28 deletions
+2 -2
View File
@@ -23,10 +23,10 @@ const outputFile = entrypoints
const ext = path.extname(file)
if (ext === '.js') {
return `<script defer="defer" src="/static/js/${file}"></script>`
return `<script defer="defer" src="{{staticCDNHost}}/static/js/${file}"></script>`
}
if (ext === '.css') {
return `<link rel="stylesheet" href="/static/css/${file}">`
return `<link rel="stylesheet" href="{{staticCDNHost}}/static/css/${file}">`
}
return ''