diff --git a/.gitignore b/.gitignore index fe703b5..e3aaaf1 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,4 @@ dist .DS_Store /static/tailwind.css +/_cache diff --git a/helpers/incremental/caching.js b/helpers/incremental/caching.js index 24bd3a7..1c7ecbc 100644 --- a/helpers/incremental/caching.js +++ b/helpers/incremental/caching.js @@ -9,9 +9,12 @@ import { isNetlify, rootDir } from '../environment.js' // https://github.com/hanbyul-here/nuxt-incremental-build-exp/blob/cb3ef6b001b283de77efee64733db273d991129b/cache-me.js -export const CACHE_PATH = isNetlify - ? path.join('/', 'opt', 'build', 'cache', 'app_build') // Netlify cache path - : path.join(rootDir, '.app_build_cache')//path.resolve(__dirname, '.app_build_cache') +// export const CACHE_PATH = isNetlify +// ? path.join('/', 'opt', 'build', 'cache', 'app_build') // Netlify cache path +// : path.join(rootDir, '.app_build_cache')//path.resolve(__dirname, '.app_build_cache') + + +export const CACHE_PATH = path.join(rootDir, '_cache') export async function getNetlifyConfig () { diff --git a/helpers/incremental/caching.test.js b/helpers/incremental/caching.test.js index bd1e87f..8e38de1 100644 --- a/helpers/incremental/caching.test.js +++ b/helpers/incremental/caching.test.js @@ -26,7 +26,7 @@ test('Can cache publish folder', async (t) => { // we check if a cached file already exists if ( await hasCachedPublishFolder() ) { - t.log('Publish folder has been cached already') + t.log(`Found cached publich folder at ${ CACHE_PATH }`) t.pass() return diff --git a/netlify.toml b/netlify.toml index 7b9c62c..6e641e5 100644 --- a/netlify.toml +++ b/netlify.toml @@ -12,6 +12,8 @@ CI = "1" +[[plugins]] + package = "netlify-plugin-cache-folder" # Production context: all deploys from the Production branch set in your site’s