forked from saplinganon/imissfauna.com
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathimagesets.js
More file actions
19 lines (16 loc) · 770 Bytes
/
imagesets.js
File metadata and controls
19 lines (16 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function importAll(requireModule, pathToImage) {
return requireModule.keys().map((item, index) => item.replace('./', pathToImage));
}
// The paths have to be written out because invocation of require.context needs to be statically analyzable
export const ERROR_IMAGE_SET = importAll(
require.context('./public/imagesets/errored', false, /\.(png|jpe?g|svg|gif)$/, 'lazy-once'),
'imagesets/errored/'
);
export const HAVE_STREAM_IMAGE_SET = importAll(
require.context('./public/imagesets/have-stream', false, /\.(png|jpe?g|svg|gif)$/, 'lazy-once'),
'imagesets/have-stream/'
);
export const NO_STREAM_IMAGE_SET = importAll(
require.context('./public/imagesets/no-stream', false, /\.(png|jpe?g|svg|gif)$/, 'lazy-once'),
'imagesets/no-stream/'
);