diff --git a/index.js b/index.js index 3c8fb0e..492b20d 100644 --- a/index.js +++ b/index.js @@ -2,11 +2,12 @@ const fs = require('fs'); const path = require('path'); -const YUIDocsGenerator = require('ember-cli-addon-docs-yuidoc/lib/broccoli/generator'); const Funnel = require('broccoli-funnel'); const mergeTrees = require('broccoli-merge-trees'); const { parse, generatePreviewHead, overrideEnvironment, findEnvironment } = require('./lib/util'); +let YUIDocsGenerator; + module.exports = { name: require('./package').name, @@ -46,6 +47,10 @@ module.exports = { include: componentFilePathPatterns, }); + if (!YUIDocsGenerator) { + YUIDocsGenerator = require('ember-cli-addon-docs-yuidoc/lib/broccoli/generator'); + } + let componentDocsTree = new YUIDocsGenerator([componentJS], { project: this.project, destDir: 'storybook-docgen',