Skip to content

Commit 003cb93

Browse files
committed
fix: add build dir for files
1 parent 356e0b8 commit 003cb93

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/helpers/files.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable import/no-extraneous-dependencies */
22
import { existsSync } from 'node:fs'
3-
import { resolve } from 'node:path'
3+
import { resolve, join } from 'node:path'
44
import { cpus } from 'os'
55

66
import { NetlifyPluginConstants } from '@netlify/build'
@@ -52,14 +52,14 @@ export const storePrerenderedContent = async ({ NETLIFY_API_TOKEN, SITE_ID }:
5252
const blob = netliBlob(NETLIFY_API_TOKEN, deployID, SITE_ID)
5353
// todo: Check out setFiles within Blobs.js to see how to upload files to blob storage
5454
const limit = pLimit(Math.max(2, cpus().length))
55+
console.log(
56+
outdent`
57+
Uploading Files to Blob Storage...
58+
`)
5559

5660
const uploadFilesToBlob = async (key: string, file: string) => {
5761
try{
58-
console.log(
59-
outdent`
60-
Uploading Files to Blob Storage...
61-
`)
62-
const content = await readFile(file, 'utf8')
62+
const content = await readFile(join(BUILD_DIR, file), 'utf8')
6363
await blob.set(getNormalizedBlobKey(key), content)
6464
}catch(error){
6565
console.error(error)

0 commit comments

Comments
 (0)