makestatic-sources-loader
v1.0.24
Published
Loads source files from disc
Downloads
5
Readme
Sources Loader
Load file sources into the pipeline
Adds input files to the pipeline.
Install
yarn add makestatic-sources-loader
API
SourcesLoader
Initializes the source files that will be processed.
.before
SourcesLoader.prototype.before(context)
Propagates the list of files to process.
If the configuration option files
is an array it is used otherwise all
files in the input
directory are added to the list of files to process.
context
Object the processing context.
.sources
SourcesLoader.prototype.sources(file, context[, options])
Reads a file from disc.
If the file name matches a pattern in the matchers
configuration option
if is assigned the corresponding file extension so that it will be
renamed when the file output path is set.
If the file name matches a pattern in the ignore
configuration option
it is removed from the list of files to process.
If the file points to a directory it is removed from the list of files to process.
By default this implementation will read the file content and assign the
buffer to the file.buffer
and set the initial file.content
unless the
buffer
option is disabled.
If the buffer
option is disabled the file will still be assigned
a stat
object.
Returns a promise that resolves when the file has been read.
file
Object the current file.context
Object the processing context.options
Object plugin options.
Options
load
Boolean=true the file buffer.
Throws
Error
if the stat fails.Error
if the file read fails.
License
MIT
Created by mkdoc on March 12, 2017