Skip to content

Instantly share code, notes, and snippets.

@zachleat
Last active March 25, 2022 19:12
Show Gist options
  • Save zachleat/6f7176cf28f7d7d904936d47f8af7cc8 to your computer and use it in GitHub Desktop.
Save zachleat/6f7176cf28f7d7d904936d47f8af7cc8 to your computer and use it in GitHub Desktop.
Eleventy Cache Re-use in Serverless mode
const { EleventyServerlessBundlerPlugin } = require("@11ty/eleventy");
module.exports = function(eleventyConfig) {
let options = {
copy: [
".cache/",
],
copyOptions: {
filter: function(path) {
return !path.endsWith(".jpg") &&
!path.endsWith(".jpeg") &&
!path.endsWith(".webp") &&
!path.endsWith(".mp4") &&
!path.endsWith(".gif") &&
!path.endsWith(".png");
}
}
};
eleventyConfig.addPlugin(EleventyServerlessBundlerPlugin, Object.assign({
name: "preview",
redirects: "netlify-toml-functions",
}, options));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment