Skip to content

Commit

Permalink
feat: support program id
Browse files Browse the repository at this point in the history
  • Loading branch information
e-cloud committed Aug 3, 2016
1 parent c13799c commit c1eb617
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/brickyard.js
Expand Up @@ -66,7 +66,7 @@ class Brickyard extends EventEmitter {

const plugins = pluginLoader.getTargetPlugins(this.config.pluginStore, mergePrograms.plugins)

// 限制brickyard对象的修改
// 限制 brickyard 对象的修改
Object.seal(this)

return {
Expand Down
5 changes: 4 additions & 1 deletion lib/programLoader.js
Expand Up @@ -72,7 +72,10 @@ function getAvailableProgramRecipes(programStore) {
let basename = path.basename(relativePath, '.js')
let dirName = path.dirname(relativePath)
let key = path.join(dirName, basename).replace('\\', '/')
result[key] = require(filePath)
let recipe = require(filePath)

result[recipe.id || key] = recipe

return result
}, {})

Expand Down

0 comments on commit c1eb617

Please sign in to comment.