import {RollupMiddleware} from 'projext-plugin-rollup/src/services/server/middleware.js'
RollupMiddleware
This service creates, configures and manages an Express-like middleware for bundling Rollup.
Constructor Summary
Public Constructor | ||
public |
constructor(appLogger: Logger, events: Events, targets: Targets, rollupConfiguration: RollupConfiguration) 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 |
Private Members | ||
private |
The instance of the Rollup watcher. |
Method Summary
Public Methods | ||
public |
generate(targetToBuild: string, targetToServe: string): MiddlewareInformation Generate the middleware for a given target. |
Public Constructors
public constructor(appLogger: Logger, events: Events, targets: Targets, rollupConfiguration: RollupConfiguration) source
Class constructor.
Params:
Name | Type | Attribute | Description |
appLogger | Logger | To log information messages. |
|
events | Events | To reduce the middlewares configuration. |
|
targets | Targets | To get targets information. |
|
rollupConfiguration | RollupConfiguration | To get a target Rollup configuration. |
Public Members
public rollupConfiguration: RollupConfiguration source
A local reference for the rollupConfiguration
service.
Private Members
Public Methods
public generate(targetToBuild: string, targetToServe: string): MiddlewareInformation source
Generate the middleware for a given target.
Params:
Name | Type | Attribute | Description |
targetToBuild | string | The name of the target that will be builded on the middleware. |
|
targetToServe | string | The name of the target that will implement the middleware.
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
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 |