distribution and site management
This commit is contained in:
+8
-20
@@ -1,25 +1,13 @@
|
||||
const path = require('path');
|
||||
|
||||
const loadList = () => {
|
||||
const paths = [
|
||||
path.join(__dirname, '..', 'build', 'svg_list.json'),
|
||||
path.join(__dirname, '..', 'svg_list.json'),
|
||||
];
|
||||
for (let p = 0; p < paths.length; p++) {
|
||||
try {
|
||||
return require(paths[p]);
|
||||
} catch (err) {
|
||||
//ignored
|
||||
}
|
||||
}
|
||||
console.error('fa-diagrams: SVG list was not found at the following paths:\n\t* ' + paths.join('\n\t* '));
|
||||
return {};
|
||||
};
|
||||
|
||||
const list = loadList();
|
||||
let list = {};
|
||||
try {
|
||||
list = require('../svg_list.json');
|
||||
}catch(err){
|
||||
console.error('fa-diagrams: SVG list could not be loaded', err);
|
||||
}
|
||||
|
||||
const self = {
|
||||
list: list
|
||||
};
|
||||
|
||||
module.exports = self;
|
||||
module.exports = self; // Node
|
||||
global['faDiagrams'] = self; // Browserify
|
||||
Reference in New Issue
Block a user