-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
Milestone
Description
Thumbnails for the models/datasources in the frontend are kept here.
Fix
Lines 62 to 80 in 1fe8767
| // Load the thumbnail images | |
| // | |
| // require.context returns a webpack object, which is callable. | |
| // Calling it with the name of a resource returns the path to that | |
| // resource. It also has a '.keys()' method, which returns all the | |
| // included resources | |
| const model_thumbnails_ctxt = require.context( | |
| './data/thumbnails/models', false, /\.jpg$/ | |
| ); | |
| // From the webpack object, make a dictionary from the resource name | |
| // to its path | |
| // | |
| // Could strip the leading './' and trailing extension (and then handle | |
| // several file types) | |
| const model_thumbnails = model_thumbnails_ctxt.keys().reduce((dict, mod) => { | |
| dict[mod] = model_thumbnails_ctxt(mod); | |
| return dict; | |
| }, {}); |