Setup netlify-plugin-cache-folder

This commit is contained in:
Sam Carlton 2021-06-11 16:28:45 -05:00
parent fb17befafd
commit 85254fe0f4
4 changed files with 10 additions and 4 deletions

1
.gitignore vendored
View file

@ -92,3 +92,4 @@ dist
.DS_Store .DS_Store
/static/tailwind.css /static/tailwind.css
/_cache

View file

@ -9,9 +9,12 @@ import { isNetlify, rootDir } from '../environment.js'
// https://github.com/hanbyul-here/nuxt-incremental-build-exp/blob/cb3ef6b001b283de77efee64733db273d991129b/cache-me.js // https://github.com/hanbyul-here/nuxt-incremental-build-exp/blob/cb3ef6b001b283de77efee64733db273d991129b/cache-me.js
export const CACHE_PATH = isNetlify // export const CACHE_PATH = isNetlify
? path.join('/', 'opt', 'build', 'cache', 'app_build') // Netlify cache path // ? path.join('/', 'opt', 'build', 'cache', 'app_build') // Netlify cache path
: path.join(rootDir, '.app_build_cache')//path.resolve(__dirname, '.app_build_cache') // : path.join(rootDir, '.app_build_cache')//path.resolve(__dirname, '.app_build_cache')
export const CACHE_PATH = path.join(rootDir, '_cache')
export async function getNetlifyConfig () { export async function getNetlifyConfig () {

View file

@ -26,7 +26,7 @@ test('Can cache publish folder', async (t) => {
// we check if a cached file already exists // we check if a cached file already exists
if ( await hasCachedPublishFolder() ) { if ( await hasCachedPublishFolder() ) {
t.log('Publish folder has been cached already') t.log(`Found cached publich folder at ${ CACHE_PATH }`)
t.pass() t.pass()
return return

View file

@ -12,6 +12,8 @@
CI = "1" CI = "1"
[[plugins]]
package = "netlify-plugin-cache-folder"
# Production context: all deploys from the Production branch set in your sites # Production context: all deploys from the Production branch set in your sites