Skip to content

Commit c507227

Browse files
knownasilyadavewasmer
authored andcommitted
fix: change default blueprint name to 'default' rather than the addon's name (#51)
Should resolve denali-js/core#435
1 parent c69b969 commit c507227

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/blueprint.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,13 @@ export default class Blueprint extends Command {
124124
.reduce<{ [key: string]: typeof Blueprint }>((BlueprintsSoFar, dirname: string) => {
125125
let BlueprintClass;
126126
try {
127-
BlueprintClass = require(path.join(dir, dirname));
127+
let Klass = require(path.join(dir, dirname));
128+
BlueprintClass = Klass.default || Klass;
128129
} catch (e) {
129130
throw new NestedError(`Unable to load blueprint from ${ dir } -> ${ dirname }`, e);
130131
}
131132
BlueprintClass.addon = addonName;
132-
BlueprintsSoFar[dirname] = BlueprintClass.default || BlueprintClass;
133+
BlueprintsSoFar[dirname] = BlueprintClass;
133134
return BlueprintsSoFar;
134135
}, {});
135136
// Capture the source directory of the blueprint

0 commit comments

Comments
 (0)