Module | Sprockets::Processing |
In: |
lib/sprockets/processing.rb
|
`Processing` is an internal mixin whose public methods are exposed on the `Environment` and `Index` classes.
Returns an `Array` of `Processor` classes. If a `mime_type` argument is supplied, the processors registered under that extension will be returned.
Bundle Processors are ran on concatenated assets rather than individual files.
All `Processor`s must follow the `Tilt::Template` interface. It is recommended to subclass `Tilt::Template`.
Assign a compressor to run on `text/css` assets.
The compressor object must respond to `compress` or `compile`.
Assign a compressor to run on `application/javascript` assets.
The compressor object must respond to `compress` or `compile`.
Returns an `Array` of `Processor` classes. If a `mime_type` argument is supplied, the processors registered under that extension will be returned.
Postprocessors are ran after Preprocessors and Engine processors.
All `Processor`s must follow the `Tilt::Template` interface. It is recommended to subclass `Tilt::Template`.
Returns an `Array` of `Processor` classes. If a `mime_type` argument is supplied, the processors registered under that extension will be returned.
Preprocessors are ran before Postprocessors and Engine processors.
All `Processor`s must follow the `Tilt::Template` interface. It is recommended to subclass `Tilt::Template`.
Registers a new Bundle Processor `klass` for `mime_type`.
register_bundle_processor 'text/css', Sprockets::CharsetNormalizer
A block can be passed for to create a shorthand processor.
register_bundle_processor :my_processor do |context, data| data.gsub(...) end
Registers a new Postprocessor `klass` for `mime_type`.
register_postprocessor 'text/css', Sprockets::CharsetNormalizer
A block can be passed for to create a shorthand processor.
register_postprocessor :my_processor do |context, data| data.gsub(...) end
Registers a new Preprocessor `klass` for `mime_type`.
register_preprocessor 'text/css', Sprockets::DirectiveProcessor
A block can be passed for to create a shorthand processor.
register_preprocessor :my_processor do |context, data| data.gsub(...) end
Remove Bundle Processor `klass` for `mime_type`.
unregister_bundle_processor 'text/css', Sprockets::CharsetNormalizer
Remove Postprocessor `klass` for `mime_type`.
unregister_postprocessor 'text/css', Sprockets::DirectiveProcessor