diff --git a/package.json b/package.json index 5cfb4a7..20c88e0 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "babel-runtime": "^5.8.24", "dox": "^0.8.0", "globby": "^3.0.0", + "mkdirp": "^0.5.1", "react-docgen": "^2.1.0", "yargs": "^3.24.0" }, diff --git a/src/util.js b/src/util.js index 887cae3..3d2f681 100644 --- a/src/util.js +++ b/src/util.js @@ -1,6 +1,7 @@ import path from 'path'; import fs from 'fs'; +import mkdirp from 'mkdirp'; export function generateManifest(options, items) { if (options.dest) { @@ -10,6 +11,7 @@ export function generateManifest(options, items) { let contents = `module.exports = [${items}];`; if (options.dest) { + mkdirp.sync(path.dirname(options.dest)); fs.writeFileSync(options.dest, contents); } else { console.log(contents);