diff --git a/packages/create-block/lib/output.js b/packages/create-block/lib/output.js index 71d2e9ebe86e5..609a028aa8034 100644 --- a/packages/create-block/lib/output.js +++ b/packages/create-block/lib/output.js @@ -18,7 +18,10 @@ const writeOutputTemplate = async ( inputFile, outputFile, view ) => { if ( renderedFile.trim().length ) { const outputFilePath = join( view.rootDirectory, outputFile ); await makeDir( dirname( outputFilePath ) ); - writeFile( outputFilePath, renderedFile ); + writeFile( + outputFilePath.replace( /\$slug/g, view.slug ), + renderedFile + ); } };