@flatjs/evolve 2.1.0-next.26 → 2.1.0-next.27
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
import{join}from"node:path";import WebpackDevServer from"webpack-dev-server";export const addCompilerToDevServer=(e,
|
1
|
+
import{join}from"node:path";import WebpackDevServer from"webpack-dev-server";export const addCompilerToDevServer=(e,r,t,o,s)=>{const{projectCwd:d,devServer:l}=s,a=new WebpackDevServer({server:{type:l?.https?"https":"http",options:{...l?.https}},open:!1,compress:!0,port:t,hot:r,liveReload:!r,allowedHosts:"all",static:{directory:`${join(d,"/public")}`},headers:{"Access-Control-Allow-Origin":"*"},setupMiddlewares:e=>(l?.devBeforeMiddlewares&&e.unshift(...l.devBeforeMiddlewares),l?.devAfterMiddlewares&&e.push(...l.devAfterMiddlewares),e),client:{progress:!0,overlay:l?.clientOverlay,webSocketURL:"localIp"===l?.webSocketURL?{hostname:o||void 0}:{hostname:"0.0.0.0",...l?.webSocketURL}}},e);return new Promise(((e,r)=>{a.startCallback((t=>{if(t)return r(t);e(!0)}))}))};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { type RequestHandler } from 'express';
|
2
|
-
import { type ClientConfiguration, type WebSocketURL } from 'webpack-dev-server';
|
2
|
+
import { type ClientConfiguration, Middleware, type WebSocketURL } from 'webpack-dev-server';
|
3
3
|
import { type FlatMockOptions, type SecureContextHttps } from '@flatjs/mock';
|
4
4
|
import { type EvolveEntryMapContent } from './types-entry-map.js';
|
5
5
|
export interface WebpackWatchOptions {
|
@@ -36,6 +36,18 @@ export type FlatEvolveDevServerOptions = {
|
|
36
36
|
* This configuration will be merged into `webpack-dev-server`
|
37
37
|
*/
|
38
38
|
watchOptions?: WebpackWatchOptions;
|
39
|
+
/**
|
40
|
+
* Provides the ability to execute a custom function and apply custom middleware(s).
|
41
|
+
* https://webpack.js.org/configuration/dev-server/#devserversetupmiddlewares
|
42
|
+
* @default []
|
43
|
+
*/
|
44
|
+
devBeforeMiddlewares?: Middleware[];
|
45
|
+
/**
|
46
|
+
* Provides the ability to execute a custom function and apply custom middleware(s).
|
47
|
+
* https://webpack.js.org/configuration/dev-server/#devserversetupmiddlewares
|
48
|
+
* @default []
|
49
|
+
*/
|
50
|
+
devAfterMiddlewares?: Middleware[];
|
39
51
|
/**
|
40
52
|
* Allow us costomized global serve data injected into `window.GLOBAL = {...globalData}`
|
41
53
|
*/
|