Home Reference Source

Function

Static Public Summary
public

Shorthand method to create an instance of ProjextRollupCompressionPlugin.

public

Shorthand method to create an instance of ProjextRollupCopyPlugin.

public

Shorthand method to create an instance of ProjextRollupCSSPlugin.

public

Shorthand method to create an instance of ProjextRollupDevServerPlugin.

public

extraWatch(files: Array, name: string): Object

This is a Rollup plugin that allows the building process to watch additional files that may not be included on the entry point in order to restart the process.

public

moduleReplace(options: *, name: *)

public

Shorthand method to create an instance of ProjextRollupNodeRunnerPlugin.

public

rollupFrontendFs(getDirectory: RollupMiddlewareGetDirectory, getFileSystem: RollupMiddlewareGetFileSystem): Provider

Generate a Provider with an already defined getDirectory and getFileSystem functions.

public

runtimeReplace(definitionsFn: Function():Object, name: string): ProjextRollupRuntimeReplacePlugin

Shorthand method to create an instance of ProjextRollupRuntimeReplacePlugin

public

Shorthand method to create an instance of ProjextRollupStatsPlugin.

public

Shorthand method to create an instance of ProjextRollupStylesheetAssetsPlugin.

public

Shorthand method to create an instance of ProjextRollupStylesheetAssetsHelperPlugin.

public

Shorthand method to create an instance of ProjextRollupStylesheetModulesFixerPlugin.

public

Shorthand method to create an instance of ProjextRollupTemplatePlugin.

public

Shorthand method to create an instance of ProjextRollupURLsPlugin.

public

useExpress(expressApp: Express, targetToBuild: string, targetToServe: string): MiddlewareInformation

Implements the Rollup middleware for a target on an Express app.

public

useJimpex(jimpexApp: Jimpex, targetToBuild: string, targetToServe: string): MiddlewareInformation

Implements the Rollup middleware for a target on a Jimpex app.

public

Shorthand method to create an instance of ProjextRollupWindowAsGlobalPlugin.

Static Public

public compression(options: ProjextRollupCompressionPluginOptions, name: string): ProjextRollupCompressionPlugin source

Shorthand method to create an instance of ProjextRollupCompressionPlugin.

Params:

NameTypeAttributeDescription
options ProjextRollupCompressionPluginOptions

The options to customize the plugin behaviour.

name string

The name of the plugin's instance.

public copy(options: ProjextRollupCopyPluginOptions, name: string): ProjextRollupCopyPlugin source

Shorthand method to create an instance of ProjextRollupCopyPlugin.

Params:

NameTypeAttributeDescription
options ProjextRollupCopyPluginOptions

The options to customize the plugin behaviour.

name string

The name of the plugin's instance.

public css(options: ProjextRollupCSSPluginOptions, name: string): ProjextRollupCSSPlugin source

Shorthand method to create an instance of ProjextRollupCSSPlugin.

Params:

NameTypeAttributeDescription
options ProjextRollupCSSPluginOptions

The options to customize the plugin behaviour.

name string

The name of the plugin's instance.

public devServer(options: ProjextRollupDevServerPluginOptions, name: string): ProjextRollupDevServerPlugin source

Shorthand method to create an instance of ProjextRollupDevServerPlugin.

Params:

NameTypeAttributeDescription
options ProjextRollupDevServerPluginOptions

The options to customize the plugin behaviour.

name string

The name of the plugin's instance.

public extraWatch(files: Array, name: string): Object source

This is a Rollup plugin that allows the building process to watch additional files that may not be included on the entry point in order to restart the process. The reason this is not defined as a class it's because it needs access to .addWatchFile, which is only available on the execution context of the transform hook.

Params:

NameTypeAttributeDescription
files Array

The list of additional files to watch and ONE CONNECTED TO THE BUNDLE. The reason for that is because the plugin uses the transform hook for that file to register the list of files.

name string
  • optional
  • default: 'projext-rollup-plugin-extra-watch'

The name of the plugin's instance.

Return:

Object

plugin

Return Properties:

NameTypeAttributeDescription
name string

The name of the plugin's instance.

transform Function

The transform hook the plugin will use to add the additional files.

Throw:

Error

if files is not an array or if it's empty.

public moduleReplace(options: *, name: *) source

Params:

NameTypeAttributeDescription
options *
name *

public nodeRunner(options: ProjextRollupNodeRunnerPluginOptions, name: string): ProjextRollupNodeRunnerPlugin source

Shorthand method to create an instance of ProjextRollupNodeRunnerPlugin.

Params:

NameTypeAttributeDescription
options ProjextRollupNodeRunnerPluginOptions

The options to customize the plugin behaviour.

name string

The name of the plugin's instance.

public rollupFrontendFs(getDirectory: RollupMiddlewareGetDirectory, getFileSystem: RollupMiddlewareGetFileSystem): Provider source

import {rollupFrontendFs} from 'projext-plugin-rollup/src/jimpex/frontendFs.js'

Generate a Provider with an already defined getDirectory and getFileSystem functions.

Params:

NameTypeAttributeDescription
getDirectory RollupMiddlewareGetDirectory

A function to get the directory where Rollup is bundling the files.

getFileSystem RollupMiddlewareGetFileSystem

A function to get access to the file system after Rollup finishes bundling the files.

Return:

Provider

Example:

// Generate the provider
const provider = rollupFrontendFs(() => 'some-dir', () => ...);
// Register it on the container
container.register(provider);
// Getting access to the service instance
const frontendFs = container.get('frontendFs');

public runtimeReplace(definitionsFn: Function():Object, name: string): ProjextRollupRuntimeReplacePlugin source

Shorthand method to create an instance of ProjextRollupRuntimeReplacePlugin

Params:

NameTypeAttributeDescription
definitionsFn Function():Object

When this function is called, it should return the object with the definitions.

name string
  • optional

The name of the plugin's instance.

public stats(options: ProjextRollupStatsPluginOptions, name: string): ProjextRollupStatsPlugin source

Shorthand method to create an instance of ProjextRollupStatsPlugin.

Params:

NameTypeAttributeDescription
options ProjextRollupStatsPluginOptions

The options to customize the plugin behaviour.

name string

The name of the plugin's instance.

public stylesheetAssets(options: ProjextRollupStylesheetAssetsPluginOptions, name: string): ProjextRollupStylesheetAssetsPlugin source

Shorthand method to create an instance of ProjextRollupStylesheetAssetsPlugin.

Params:

NameTypeAttributeDescription
options ProjextRollupStylesheetAssetsPluginOptions

The options to customize the plugin behaviour.

name string

The name of the plugin's instance.

public stylesheetAssetsHelper(options: ProjextRollupStylesheetAssetsHelperPluginOptions, name: string): ProjextRollupStylesheetAssetsHelperPlugin source

Shorthand method to create an instance of ProjextRollupStylesheetAssetsHelperPlugin.

Params:

NameTypeAttributeDescription
options ProjextRollupStylesheetAssetsHelperPluginOptions

The options to customize the plugin behaviour.

name string
  • optional

The name of the plugin's instance.

public stylesheetModulesFixer(options: ProjextRollupStylesheetModulesFixerPluginOptions, name: string): ProjextRollupStylesheetModulesFixerPlugin source

Shorthand method to create an instance of ProjextRollupStylesheetModulesFixerPlugin.

Params:

NameTypeAttributeDescription
options ProjextRollupStylesheetModulesFixerPluginOptions

The options to customize the plugin behaviour.

name string

The name of the plugin's instance.

public template(options: ProjextRollupTemplatePluginOptions, name: string): ProjextRollupTemplatePlugin source

Shorthand method to create an instance of ProjextRollupTemplatePlugin.

Params:

NameTypeAttributeDescription
options ProjextRollupTemplatePluginOptions

The options to customize the plugin behaviour.

name string

The name of the plugin's instance.

public urls(options: ProjextRollupURLsPluginOptions, name: string): ProjextRollupURLsPlugin source

Shorthand method to create an instance of ProjextRollupURLsPlugin.

Params:

NameTypeAttributeDescription
options ProjextRollupURLsPluginOptions

The options to customize the plugin behaviour.

name string

The name of the plugin's instance.

public useExpress(expressApp: Express, targetToBuild: string, targetToServe: string): MiddlewareInformation source

import useExpress from 'projext-plugin-rollup/src/express.js'

Implements the Rollup middleware for a target on an Express app.

Params:

NameTypeAttributeDescription
expressApp Express

The app where the middleware is going to be used.

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 getDirectory(), it will think they are both on the distribution directory and the paths can be created relative to that.

public useJimpex(jimpexApp: Jimpex, targetToBuild: string, targetToServe: string): MiddlewareInformation source

import useJimpex from 'projext-plugin-rollup/src/jimpex.js'

Implements the Rollup middleware for a target on a Jimpex app.

Params:

NameTypeAttributeDescription
jimpexApp Jimpex

The app where the middleware is going to be registered.

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 getDirectory(), it will think they are both on the distribution directory and the paths can be created relative to that.

public windowAsGlobal(): ProjextRollupWindowAsGlobalPlugin source

Shorthand method to create an instance of ProjextRollupWindowAsGlobalPlugin.