Created
June 27, 2017 12:27
-
-
Save stoikerty/33dcedd88a8bc28f75053c79cdd81146 to your computer and use it in GitHub Desktop.
Example of how dev-toolit v5 handles server-rendering of images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// filesHook.js - adapted from [email protected] | |
import filesHook from 'files-require-hook'; | |
const rootForRequire = process.cwd(); | |
// Set up server-side rendering of image files | |
// --- | |
// Implement a hook that uses a file-path for node | |
export default () => { | |
filesHook({ | |
extensions: ['jpg', 'jpeg', 'png', 'gif', 'svg'], | |
base: rootForRequire, | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment