@@ -199,10 +199,10 @@ const noop = () => {};
199199 * @returns {API<RequestInternal, ResponseInternal> } webpack dev middleware
200200 */
201201function wdm ( compiler , options = { } , isPlugin = false ) {
202- validate ( /** @type {Schema } */ ( schema ) , options , {
203- name : "Dev Middleware" ,
204- baseDataPath : "options" ,
205- } ) ;
202+ // validate(/** @type {Schema } */ (schema), options, {
203+ // name: "Dev Middleware",
204+ // baseDataPath: "options",
205+ // });
206206
207207 const { mimeTypes } = options ;
208208
@@ -539,7 +539,7 @@ wdm.koaWrapper = koaWrapper;
539539 * @template {IncomingMessage} [RequestInternal=IncomingMessage]
540540 * @template {ServerResponse} [ResponseInternal=ServerResponse]
541541 * @param {Compiler | MultiCompiler } compiler compiler
542- * @param {Options<RequestInternal, ResponseInternal>= } options options
542+ * @param {Options<RequestInternal, ResponseInternal> & { debug?: boolean } = } options options
543543 * @param {boolean= } usePlugin true when need to use as a plugin, otherwise false
544544 * @returns {(ctx: EXPECTED_ANY, next: EXPECTED_FUNCTION) => Promise<void> | void } hono wrapper
545545 */
@@ -639,7 +639,7 @@ function honoWrapper(compiler, options = {}, usePlugin = false) {
639639 * @param {import("fs").ReadStream } stream readable stream
640640 */
641641 res . stream = ( stream ) => {
642- if ( options . writeToDisk === true ) {
642+ if ( options . writeToDisk === true && options . debug ) {
643643 console . error ( stream ) ;
644644 }
645645
@@ -649,7 +649,7 @@ function honoWrapper(compiler, options = {}, usePlugin = false) {
649649 * @param {Error= } err err
650650 */
651651 const onEvent = ( err ) => {
652- if ( options . writeToDisk === true ) {
652+ if ( options . writeToDisk === true && options . debug ) {
653653 console . error ( "onEvent" , err ) ;
654654 }
655655
@@ -669,7 +669,7 @@ function honoWrapper(compiler, options = {}, usePlugin = false) {
669669 body = stream ;
670670 isFinished = true ;
671671
672- if ( options . writeToDisk === true ) {
672+ if ( options . writeToDisk === true && options . debug ) {
673673 console . error ( "resolve" , isFinished ) ;
674674 }
675675
@@ -729,7 +729,7 @@ function honoWrapper(compiler, options = {}, usePlugin = false) {
729729 } ,
730730 ) ;
731731 } catch ( err ) {
732- if ( options . writeToDisk === true ) {
732+ if ( options . writeToDisk === true && options . debug ) {
733733 console . error ( "catch" , err ) ;
734734 }
735735
@@ -744,15 +744,15 @@ function honoWrapper(compiler, options = {}, usePlugin = false) {
744744 return context . json ( { message : /** @type {Error } */ ( err ) . message } ) ;
745745 }
746746
747- if ( options . writeToDisk === true ) {
747+ if ( options . writeToDisk === true && options . debug ) {
748748 console . error ( "body" , body ) ;
749749 }
750750
751751 if ( typeof body !== "undefined" ) {
752752 return context . body ( body , status ) ;
753753 }
754754
755- if ( options . writeToDisk === true ) {
755+ if ( options . writeToDisk === true && options . debug ) {
756756 console . error ( "next" ) ;
757757 }
758758
0 commit comments