Skip to content

Instantly share code, notes, and snippets.

@stoikerty
Created June 27, 2017 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stoikerty/33dcedd88a8bc28f75053c79cdd81146 to your computer and use it in GitHub Desktop.
Save stoikerty/33dcedd88a8bc28f75053c79cdd81146 to your computer and use it in GitHub Desktop.
Example of how dev-toolit v5 handles server-rendering of images
// filesHook.js - adapted from dev-toolkit@5.5.4
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