git ssb

16+

Dominic / patchbay



Commit 72483d41ff0fbb76209ef40a0cdcf91409b6db7f

build script which generates plugin loader

Dominic Tarr committed on 6/24/2016, 9:46:50 PM
Parent: 783d336f14fe7f13b2784e33007e0ac65afeeeea

Files changed

index.jschanged
build.jsadded
index.jsView
@@ -5,12 +5,13 @@
55 var fs = require('fs')
66 var path = require('path')
77 var SbotApi = require('./sbot-api')
88
9-document.head.appendChild(h('style', fs.readFileSync('./style.css', 'utf8')))
9+document.head.appendChild(
10+ h('style', fs.readFileSync('./style.css', 'utf8')
11+))
1012
11-var modules = fs.readdirSync(path.join(__dirname, 'modules'))
12- .map(function (e) { return require('./modules/'+e) })
13+var modules = require('./modules')
1314
1415 var renderers = []
1516 var app = []
1617 var App = require('./plugs').first(app)
@@ -28,4 +29,5 @@
2829
2930
3031
3132
33+
build.jsView
@@ -1,0 +1,13 @@
1+
2+console.log(
3+ 'module.exports = [\n',
4+ require('fs').readdirSync(require('path').join(__dirname, 'modules'))
5+ .filter(function (file) {
6+ return file !== 'index.js'
7+ })
8+ .map(function (file) {
9+ return " require('./"+file+"')"
10+ }).join(',\n'),
11+ '\n]'
12+)
13+

Built with git-ssb-web