import {ProjextRollupCSSPlugin} from 'projext-plugin-rollup/src/plugins/css/index.js'ProjextRollupCSSPlugin
This is a Rollup plugin for handling CSS stylesheets: Move them into a separated bundle, inject them when the browser loads the app and transform them into strings so they can be used on Node.
Constructor Summary
| Public Constructor | ||
| public |
constructor(options: ProjextRollupCSSPluginOptions, name: string) |
|
Member Summary
| Public Members | ||
| public |
The filter to decide which files will be processed and which won't. |
|
| public |
The name of the plugin instance. |
|
Method Summary
| Public Methods | ||
| public |
Gets the plugin options |
|
| public |
This gets called when Rollup starts the bundling process. |
|
| public |
Processes a file in order to determine whether it should export an empty string (in case the styles are being moved to a bundle), export the code and/or add extra named exports. |
|
| public |
This gets called by Rollup when the bundle is being generated. |
|
Public Constructors
public constructor(options: ProjextRollupCSSPluginOptions, name: string) source
Params:
| Name | Type | Attribute | Description |
| options | ProjextRollupCSSPluginOptions |
|
The options to customize the plugin behaviour. |
| name | string |
|
The name of the plugin's instance. |
Public Members
public filter: RollupFilter source
The filter to decide which files will be processed and which won't.
Public Methods
public intro(): string source
This gets called when Rollup starts the bundling process. If the insert option was set to
true, this method will return the custom function the bundle will use to inject the
styles on the <head />.
public transform(code: string, filepath: string): Promise<RollupFileDefinition, Error> source
Processes a file in order to determine whether it should export an empty string (in case the styles are being moved to a bundle), export the code and/or add extra named exports.
public writeBundle() source
This gets called by Rollup when the bundle is being generated. It takes care, if needed, to create the stylesheet bundle.
