import {WebpackMiddlewares} from 'projext-plugin-webpack/src/services/server/middlewares.js'
WebpackMiddlewares
This service creates and manages middlewares for webpack server implementations.
Constructor Summary
Public Constructor | ||
public |
constructor(events: Events, targets: Targets, webpackConfiguration: WebpackConfiguration, webpackPluginInfo: WebpackPluginInfo) Class constructor. |
Member Summary
Public Members | ||
public |
A local reference for the |
|
public |
A local reference for the |
|
public |
A local reference for the |
|
public |
A local reference for the plugin information. |
Method Summary
Public Methods | ||
public |
generate(targetToBuild: string, targetToServe: string): MiddlewaresInformation Generate the middlewares for a given target. |
Public Constructors
public constructor(events: Events, targets: Targets, webpackConfiguration: WebpackConfiguration, webpackPluginInfo: WebpackPluginInfo) source
Class constructor.
Params:
Name | Type | Attribute | Description |
events | Events | To reduce the middlewares configuration. |
|
targets | Targets | To get targets information. |
|
webpackConfiguration | WebpackConfiguration | To get a target webpack configuration in order to instantiate the middlewares. |
|
webpackPluginInfo | WebpackPluginInfo | To get the name of the plugin and use it on the webpack hook that resolves the file system when the middleware finishes bundling. |
Public Members
public webpackConfiguration: WebpackConfiguration source
A local reference for the webpackConfiguration
service.
Public Methods
public generate(targetToBuild: string, targetToServe: string): MiddlewaresInformation source
Generate the middlewares for a given target.
Params:
Name | Type | Attribute | Description |
targetToBuild | string | The name of the target that will be builded on the middleware(s). |
|
targetToServe | string | The name of the target that will implement the middleware(s).
When the other target is builded, it will assume that is on the
distribution directory, and if the target serving it is being
executed from the source directory it won't be able to use the
dev middleware file system without hardcoding some relatives
paths from the build to the source; to avoid that, the method
gets the build path of this target, so when using
|