diff --git a/src/server/build.js b/src/server/build.js index afd0d65e45f1..440e0ef95c8d 100644 --- a/src/server/build.js +++ b/src/server/build.js @@ -66,6 +66,9 @@ webpack(config).compile(function (err, stats) { const source = asset._value; const dstPath = path.resolve(outputDir, `static/${filename}`); + + // Ensure the asset directory exists + shelljs.mkdir('-p', path.parse(dstPath).dir); fs.writeFileSync(dstPath, source); // We need to copy the manager bundle distributed via the React Storybook