Home Reference Source
import {ProjextRollupStylesheetAssetsHelperPlugin} from 'projext-plugin-rollup/src/plugins/stylesheetAssets/helper.js'
public class | source

ProjextRollupStylesheetAssetsHelperPlugin

This is Rollup helper plugin for ProjextRollupStylesheetAssetsPlugin that wraps CSS code being exported by ES modules so it can be found and fixed.

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 gets called when Rollup starts the bundling process.

public

This is called by Rollup when is parsing a file.

Public Constructors

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

Params:

NameTypeAttributeDescription
options ProjextRollupStylesheetAssetsHelperPluginOptions
  • optional
  • default: {}

The options to customize the plugin behaviour.

name string
  • optional
  • default: 'projext-rollup-plugin-stylesheet-assets-helper'

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 intro(): string source

This gets called when Rollup starts the bundling process. It returns the code for the function that will wrap the CSS styles.

Return:

string

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.