🤖 Merge PR #46882 [@types/webpack-dev-middleware] Make publicPath Option Optional by @XxX-MLGNoob-XxX

* Make publicPath Option Optional

* Add Test for Creating Instance with Empty Options

Co-authored-by: XxX-MLGNoob-XxX <thomason.isaiah@yahoo.com>
This commit is contained in:
XxX-MLGNoob-XxX 2020-08-18 18:18:52 -04:00 committed by GitHub
parent 992e59fb7b
commit de112ddd85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -62,7 +62,7 @@ declare namespace WebpackDevMiddleware {
*/
mimeTypes?: MimeTypeMap | OverrideMimeTypeMap | null;
/** The public path that the middleware is bound to */
publicPath: string;
publicPath?: string;
/** Allows users to provide a custom reporter to handle logging within the module */
reporter?: Reporter | null;
/** Instructs the module to enable or disable the server-side rendering mode */

View File

@ -3,9 +3,16 @@ import webpack = require('webpack');
import webpackDevMiddleware = require('webpack-dev-middleware');
const compiler = webpack({});
const compilerWithPublicPath = webpack({
output: {
publicPath: '/assets/'
}
});
let webpackDevMiddlewareInstance = webpackDevMiddleware(compiler);
webpackDevMiddlewareInstance = webpackDevMiddleware(compilerWithPublicPath, {});
webpackDevMiddlewareInstance = webpackDevMiddleware(compiler, {
logLevel: 'silent',
logTime: true,