feat: integrate authored nightdrive soundtrack
This commit is contained in:
@@ -57,6 +57,16 @@ const writeValidArtifacts = async (site?: SiteConfig) => {
|
||||
await mkdir(join(directory, 'assets'));
|
||||
const html = assemblePrerenderedHtml(template, manifest, await render('/', inputs), inputs);
|
||||
const hostArtifacts = createStaticHostArtifacts(createPageMetadata(inputs.content, inputs.manifest, inputs.site), inputs.site);
|
||||
const publicAssets = inputs.manifest.assets
|
||||
.map((asset) => ({
|
||||
path: `assets/${asset.fileName}`,
|
||||
bytesPath: resolve(repositoryRoot, 'inputs/prepared-assets', asset.fileName),
|
||||
}))
|
||||
.sort((left, right) => left.path.localeCompare(right.path));
|
||||
const publicAssetBytes = await Promise.all(publicAssets.map(async (asset) => ({
|
||||
...asset,
|
||||
bytes: await readFile(asset.bytesPath),
|
||||
})));
|
||||
const contract = {
|
||||
schema: 'portfolio-artifact-contract/v1',
|
||||
buildId: inputs.site.buildId,
|
||||
@@ -65,10 +75,14 @@ const writeValidArtifacts = async (site?: SiteConfig) => {
|
||||
modulePreloads: ['assets/index-test.js'],
|
||||
styles: ['assets/index-test.css'],
|
||||
viteAssets: [],
|
||||
publicAssets: [],
|
||||
publicAssets: publicAssets.map((asset) => asset.path),
|
||||
files: [
|
||||
{ path: 'assets/index-test.css', sha256: sha256(clientStylesheet) },
|
||||
{ path: 'assets/index-test.js', sha256: sha256(clientJavaScript) },
|
||||
...publicAssetBytes.map((asset) => ({
|
||||
path: asset.path,
|
||||
sha256: createHash('sha256').update(asset.bytes).digest('hex'),
|
||||
})),
|
||||
],
|
||||
} as const;
|
||||
await Promise.all([
|
||||
@@ -78,6 +92,7 @@ const writeValidArtifacts = async (site?: SiteConfig) => {
|
||||
writeFile(join(directory, '_redirects.example'), hostArtifacts.redirects),
|
||||
writeFile(join(directory, 'assets/index-test.js'), clientJavaScript),
|
||||
writeFile(join(directory, 'assets/index-test.css'), clientStylesheet),
|
||||
...publicAssetBytes.map((asset) => writeFile(join(directory, asset.path), asset.bytes)),
|
||||
...(hostArtifacts.sitemap === undefined
|
||||
? []
|
||||
: [writeFile(join(directory, 'sitemap.xml'), hostArtifacts.sitemap)]),
|
||||
|
||||
Reference in New Issue
Block a user