@@ -150,30 +150,34 @@ export default {
150150 for ( const node of headNodes ) {
151151 const result = processModuleNodes ( node ) ;
152152
153- // We minify the html result to reduce the file size and keep it "clean"
154- const minified = await minify ( result , {
155- collapseWhitespace : true ,
156- minifyJS : true ,
157- } ) ;
158-
159- await writeFile ( join ( output , `${ node . api } .html` ) , minified ) ;
153+ if ( output ) {
154+ // We minify the html result to reduce the file size and keep it "clean"
155+ const minified = await minify ( result , {
156+ collapseWhitespace : true ,
157+ minifyJS : true ,
158+ } ) ;
159+
160+ await writeFile ( join ( output , `${ node . api } .html` ) , minified ) ;
161+ }
160162 }
161163
162- // Define the output folder for API docs assets
163- const assetsFolder = join ( output , 'assets' ) ;
164-
165- // Removes the current assets directory to copy the new assets
166- // and prevent stale assets from existing in the output directory
167- // If the path does not exists, it will simply ignore and continue
168- await rm ( assetsFolder , { recursive : true , force : true } ) ;
169-
170- // We copy all the other assets to the output folder at the end of the process
171- // to ensure that all latest changes on the styles are applied to the output
172- // Note.: This is not meant to be used for DX/developer purposes.
173- await cp ( join ( baseDir , 'assets' ) , assetsFolder , {
174- recursive : true ,
175- force : true ,
176- } ) ;
164+ if ( output ) {
165+ // Define the output folder for API docs assets
166+ const assetsFolder = join ( output , 'assets' ) ;
167+
168+ // Removes the current assets directory to copy the new assets
169+ // and prevent stale assets from existing in the output directory
170+ // If the path does not exists, it will simply ignore and continue
171+ await rm ( assetsFolder , { recursive : true , force : true } ) ;
172+
173+ // We copy all the other assets to the output folder at the end of the process
174+ // to ensure that all latest changes on the styles are applied to the output
175+ // Note.: This is not meant to be used for DX/developer purposes.
176+ await cp ( join ( baseDir , 'assets' ) , assetsFolder , {
177+ recursive : true ,
178+ force : true ,
179+ } ) ;
180+ }
177181
178182 return generatedValues ;
179183 } ,
0 commit comments