(abstract, protected) new Compiler(optionsopt)
- Source:
The base compiler class
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
CompilerConfig |
<optional> |
{}
|
configuration object |
Methods
(static) done(inPath, callback)
- Source:
Executed when the compilation is complete
Parameters:
Name | Type | Description |
---|---|---|
inPath |
string | the input path |
callback |
function | a callback function |
(static) fsWrite(path, data, callback) → {void}
- Source:
Writes the data to disk
Parameters:
Name | Type | Description |
---|---|---|
path |
string | the output path |
data |
ProgramData | the data to write |
callback |
function | a callback function |
Returns:
- Type
- void
(static) gzip(data, callback) → {void}
- Source:
G-zips the compiled code
Parameters:
Name | Type | Description |
---|---|---|
data |
ProgramData | the actual program data to gzip |
callback |
ProgramDataCallback | a callback function |
Returns:
- Type
- void
(static) mkdir(path, callback)
- Source:
Recursively creates a directory containing a file specified by path
.
Parameters:
Name | Type | Description |
---|---|---|
path |
string | a path to a file |
callback |
function | a callback function |
(protected) save(inPath, outPath, data, callback)
- Source:
G-zips the program if necessary and writes the results to disk.
Skips the final write if the contents of the file have not changed since the previous write. Which adds a little overhead at compile time, but at the same time does not alter the last modified timestamp of the file unnecessarily.
Good news for someone who is using that timestamp for public cache invalidation.
Parameters:
Name | Type | Description |
---|---|---|
inPath |
string | the input path |
outPath |
string | the output path |
data |
ProgramData | processed application code with source maps |
callback |
function | a callback function |