Files: b206911bfe9aa61b8eb303bde755d1d378e4361e / styles / mcss.js
599 bytesRaw
1 | const nest = require('depnest') |
2 | const readDirectory = require('read-directory') |
3 | const path = require('path') |
4 | const { basename } = path |
5 | const { each } = require('libnested') |
6 | |
7 | const contents = readDirectory.sync(path.join(__dirname, '..'), { |
8 | extensions: false, |
9 | filter: '**/*.mcss', |
10 | ignore: '**/node_modules/**' |
11 | }) |
12 | |
13 | exports.gives = nest('styles.mcss') |
14 | |
15 | exports.create = function (api) { |
16 | return nest('styles.mcss', mcss) |
17 | |
18 | function mcss (sofar = {}) { |
19 | each(contents, (content, [filename]) => { |
20 | const name = basename(filename) |
21 | sofar[name] = content |
22 | }) |
23 | return sofar |
24 | } |
25 | } |
26 |
Built with git-ssb-web