Function
Static Public Summary | ||
public |
useExpress(expressApp: Express, targetToBuild: string, targetToServe: string): MiddlewaresInformation Implements the Webpack middlewares for a target on an Express app. |
|
public |
useJimpex(jimpexApp: Jimpex, targetToBuild: string, targetToServe: string): MiddlewaresInformation Implements the Webpack middlewares for a target on a Jimpex app. |
|
public |
webpackFrontendFs(getDirectory: DevMiddlewareGetDirectory, getFileSystem: DevMiddlewareGetFileSystem): Provider Generate a |
Static Public
public useExpress(expressApp: Express, targetToBuild: string, targetToServe: string): MiddlewaresInformation source
import useExpress from 'projext-plugin-webpack/src/express.js'
Implements the Webpack middlewares for a target on an Express app.
Params:
Name | Type | Attribute | Description |
expressApp | Express | The app where the middlewares are going to be |
|
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 |
public useJimpex(jimpexApp: Jimpex, targetToBuild: string, targetToServe: string): MiddlewaresInformation source
import useJimpex from 'projext-plugin-webpack/src/jimpex.js'
Implements the Webpack middlewares for a target on a Jimpex app.
Params:
Name | Type | Attribute | Description |
jimpexApp | Jimpex | The app where the middlewares are going to be registered. |
|
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 |
public webpackFrontendFs(getDirectory: DevMiddlewareGetDirectory, getFileSystem: DevMiddlewareGetFileSystem): Provider source
import {webpackFrontendFs} from 'projext-plugin-webpack/src/jimpex/frontendFs.js'
Generate a Provider
with an already defined getDirectory
and getFileSystem
functions.
Params:
Name | Type | Attribute | Description |
getDirectory | DevMiddlewareGetDirectory | A function to get the directory the Webpack middleware is using. |
|
getFileSystem | DevMiddlewareGetFileSystem | A function to get the virtual file system the Webpack middleware uses. It uses a Promise in order to avoid accessing it before the middleware finishes compiling. |
Example:
// Generate the provider
const provider = webpackFrontendFs(() => 'some-dir', () => middleware.fs);
// Register it on the container
container.register(provider);
// Getting access to the service instance
const frontendFs = container.get('frontendFs');