Home Reference Source
import {ProjextRollupStylesheetModulesFixerPlugin} from 'projext-plugin-rollup/src/plugins/stylesheetModulesFixer/index.js'
public class | source

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

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

This is called by Rollup when is parsing a file.

Public Constructors

public constructor(options: ProjextRollupStylesheetModulesFixerPluginOptions, name: string) source

Params:

NameTypeAttributeDescription
options ProjextRollupStylesheetModulesFixerPluginOptions
  • optional
  • default: {}

The options to customize the plugin behaviour.

name string
  • optional
  • default: 'projext-rollup-plugin-stylesheet-modules-fixer'

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 name: string source

The name of the plugin's instance.

Public Methods

public transform(code: string, filepath: string): RollupFileDefinition source

This is called by Rollup when is parsing a file.

Params:

NameTypeAttributeDescription
code string

The file contents.

filepath string

The file path.

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 null.