Skip to content
This repository was archived by the owner on Jan 2, 2022. It is now read-only.

Commit 10dcb9d

Browse files
committed
fix: use relative path
Signed-off-by: Jonah Snider <[email protected]>
1 parent 6695550 commit 10dcb9d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface NetlifyOpts {
2222
}
2323

2424
function generateAbsolutePaths(
25-
options: Pick<NetlifyOpts, 'inputs' | 'netlifyConfig'>
25+
options: Pick<NetlifyOpts, 'inputs'>
2626
): {
2727
absolute: {
2828
/** The absolute path to the build folder for Next.js. */
@@ -39,7 +39,7 @@ function generateAbsolutePaths(
3939
const buildDirPathFromProject = options.inputs.build_dir_path ?? '.';
4040

4141
/** The absolute path to the build folder for Next.js. */
42-
const absoluteBuildDirPath = joinPaths(options.netlifyConfig.build.base, buildDirPathFromProject, buildDirName, 'cache');
42+
const absoluteBuildDirPath = joinPaths(buildDirPathFromProject, buildDirName, 'cache');
4343
/** The absolute path to the build manifest Next.js uses. */
4444
// I don't actually know if this build manifest has any relation to the cache folder
4545
const manifestPath = joinPaths(absoluteBuildDirPath, '..', 'build-manifest.json');
@@ -59,8 +59,8 @@ module.exports = {
5959
// Does not do anything if:
6060
// - the file/directory already exists locally
6161
// - the file/directory has not been cached yet
62-
async onPreBuild({utils, netlifyConfig, inputs}: NetlifyOpts) {
63-
const paths = generateAbsolutePaths({netlifyConfig, inputs});
62+
async onPreBuild({utils, inputs}: NetlifyOpts) {
63+
const paths = generateAbsolutePaths({inputs});
6464
const success = await utils.cache.restore(paths.absolute.buildDir);
6565

6666
if (success) {
@@ -76,10 +76,10 @@ module.exports = {
7676
// If this is a directory, this includes children's contents
7777
// Note that this will cache after the build, even if it fails, which fcould be unwanted behavior
7878
async onPostBuild({utils, netlifyConfig, inputs}: NetlifyOpts) {
79-
const paths = generateAbsolutePaths({netlifyConfig, inputs});
79+
const paths = generateAbsolutePaths({inputs});
8080

8181
const success = await utils.cache.save(paths.absolute.buildDir, {
82-
digests: [paths.absolute.manifest]
82+
digests: [paths.absolute.manifest]
8383
});
8484

8585
if (success) {

0 commit comments

Comments
 (0)