Skip to content

Commit

Permalink
Dynamically detect package names
Browse files Browse the repository at this point in the history
Note that getPanes() can only be used server-side. To actually load
them, the server should generate client-side scripts that actually
include the pane, preferably without already including the pane's
code in the initial payload.
  • Loading branch information
Vinnl committed May 28, 2019
1 parent c482fc3 commit fbe4bcd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/panes/getPanes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const path = require('path')
const fs = require('fs')

function getPanes () {
const paneNames = ['scratchpad']
const paneNames = fs.readdirSync(__dirname)
.filter(fileOrDir => fs.statSync(path.join(__dirname, fileOrDir)).isDirectory())
.filter(directory => directory !== 'webpack-config-panes')

const panes = paneNames.map(name => ({ name: name, path: getPaneDir(name) }))

Expand Down

0 comments on commit fbe4bcd

Please sign in to comment.