parent
afb7827f40
commit
8d64bf2697
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Functions for dealing with custom build configuration.
|
||||
*/
|
||||
|
||||
/** Require a custom JSON file if it exists */
|
||||
export const custom = (filename, fallback = {}) => {
|
||||
const context = require.context('custom', false, /\.json$/);
|
||||
const path = `./${filename}.json`;
|
||||
|
||||
return context.keys().includes(path) ? context(path) : fallback;
|
||||
};
|
Loading…
Reference in new issue