import {ProjextRollupStylesheetModulesFixerPlugin} from 'projext-plugin-rollup/src/plugins/stylesheetModulesFixer/index.js'
ProjextRollupStylesheetModulesFixerPlugin
This is a Rollup plugin that replaces the default export statements of stylesheet modules with the CSS modules local names. This is for web apps that either inject CSS using functions or bundle all on separated files, because it searches for functions (inject) or empty strings (bundle) on exports.
Constructor Summary
Public Constructor | ||
public |
constructor(options: ProjextRollupStylesheetModulesFixerPluginOptions, 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's instance. |
Method Summary
Public Methods | ||
public |
Gets the plugin options |
|
public |
transform(code: string, filepath: string): RollupFileDefinition This is called by Rollup when is parsing a file. |
Public Constructors
public constructor(options: ProjextRollupStylesheetModulesFixerPluginOptions, name: string) source
Params:
Name | Type | Attribute | Description |
options | ProjextRollupStylesheetModulesFixerPluginOptions |
|
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 getOptions(): ProjextRollupStylesheetModulesFixerPluginOptions source
Gets the plugin options
public transform(code: string, filepath: string): RollupFileDefinition source
This is called by Rollup when is parsing a file.
Return:
RollupFileDefinition (nullable: true) | If the file matches the plugin filter, it will parse it and
return a new definition, otherwise it will just return |