wikimedia/minify
Minification of JavaScript code and CSS stylesheets
Loading...
Searching...
No Matches
Wikimedia\Minify\JavaScriptMapperState Class Reference

A stateful minifier for JavaScript with source map support. More...

+ Inheritance diagram for Wikimedia\Minify\JavaScriptMapperState:

Protected Member Functions

 minify (string $source)
 

Additional Inherited Members

- Public Member Functions inherited from Wikimedia\Minify\MapperState
 addSourceFile (string $url, string $source, bool $bundle=false)
 Minify a source file and collect the output and mappings data.
 
 addOutput (string $output)
 Add a string to the output without any minification or source mapping.
 
 getSourceMapData ()
 Get the source map data to be JSON encoded.
 
 getRawSourceMap ()
 Get the JSON-encoded source map.
 
 getSourceMap ()
 Get the JSON-encoded source map including XSSI protection prefix.
 
- Public Member Functions inherited from Wikimedia\Minify\MinifierState
 outputFile (string $file)
 Set the name of the output file, to be given as the "file" key.
 
 sourceRoot (string $url)
 Set the source root.
 
 setErrorHandler ( $onError)
 Register an error callback.
 
 ensureNewline ()
 Add a line break to the output if the output is non-empty and does not end in a line break.
 
 getMinifiedOutput ()
 Get the minified output.
 
- Protected Attributes inherited from Wikimedia\Minify\MapperState
 $mappingsGenerator
 
- Protected Attributes inherited from Wikimedia\Minify\MinifierState
 $sources = []
 
 $sourcesContent = []
 
 $minifiedOutput = ''
 
 $outputFile
 
 $sourceRoot
 
 $onError
 

Detailed Description

A stateful minifier for JavaScript with source map support.

Use the factory JavaScriptMinifier::createSourceMapState().

Member Function Documentation

◆ minify()

Wikimedia\Minify\JavaScriptMapperState::minify ( string $source)
protected
Parameters
string$source
Returns
string

Reimplemented from Wikimedia\Minify\MinifierState.


The documentation for this class was generated from the following file: