mirror of
https://gitlab.com/timvisee/send.git
synced 2024-11-14 07:02:30 +01:00
20 lines
465 B
JavaScript
20 lines
465 B
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
function kv(f) {
|
|
return `"${f}": require('../assets/${f}')`;
|
|
}
|
|
|
|
module.exports = function() {
|
|
const files = fs.readdirSync(path.join(__dirname, '..', 'assets'));
|
|
const code = `module.exports = {
|
|
"package.json": require('../package.json'),
|
|
${files.map(kv).join(',\n')}
|
|
};`;
|
|
return {
|
|
code,
|
|
dependencies: files.map(f => require.resolve('../assets/' + f)),
|
|
cacheable: false
|
|
};
|
|
};
|