@web/dev-server-core
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -22,3 +22,3 @@ "use strict"; | ||
throw new Error('Missing logger.'); | ||
const { app, server } = (0, createServer_1.createServer)(this.logger, this.config, this.fileWatcher, config.middlewareMode); | ||
const { app, server } = (0, createServer_1.createServer)(this.logger, this.config, this.fileWatcher, !!config.middlewareMode); | ||
this.koaApp = app; | ||
@@ -35,2 +35,6 @@ if (server) { | ||
} | ||
else if (typeof this.config.middlewareMode === 'object' && | ||
this.config.middlewareMode.server) { | ||
this.webSockets = new WebSocketsManager_1.WebSocketsManager(this.config.middlewareMode.server); | ||
} | ||
} | ||
@@ -37,0 +41,0 @@ async start() { |
@@ -0,3 +1,5 @@ | ||
/// <reference types="node" /> | ||
import { Middleware } from 'koa'; | ||
import { Plugin } from '../plugins/Plugin'; | ||
import { Server } from 'net'; | ||
export type MimeTypeMappings = Record<string, string>; | ||
@@ -22,3 +24,5 @@ export interface DevServerCoreConfig { | ||
*/ | ||
middlewareMode?: boolean; | ||
middlewareMode?: boolean | { | ||
server: Server; | ||
}; | ||
basePath?: string; | ||
@@ -25,0 +29,0 @@ /** |
{ | ||
"name": "@web/dev-server-core", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
@@ -30,3 +30,3 @@ import Koa from 'koa'; | ||
this.fileWatcher, | ||
config.middlewareMode, | ||
!!config.middlewareMode, | ||
); | ||
@@ -43,2 +43,7 @@ this.koaApp = app; | ||
}); | ||
} else if ( | ||
typeof this.config.middlewareMode === 'object' && | ||
this.config.middlewareMode.server | ||
) { | ||
this.webSockets = new WebSocketsManager(this.config.middlewareMode.server); | ||
} | ||
@@ -45,0 +50,0 @@ } |
import { Middleware } from 'koa'; | ||
import { Plugin } from '../plugins/Plugin'; | ||
import { Server } from 'net'; | ||
@@ -24,3 +25,3 @@ export type MimeTypeMappings = Record<string, string>; | ||
*/ | ||
middlewareMode?: boolean; | ||
middlewareMode?: boolean | { server: Server }; | ||
basePath?: string; | ||
@@ -27,0 +28,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
301120
5773