1.0.11 • Published 8 years ago
atma-loader v1.0.11
Atma Loader Abstraction
Used for the atma plugin creation to develop File read
middleware, like compilers and preprocessors.
Extends:
IncludeJS
with a custom loaderatma-io
with a custom middleware to read/compile/preprocess filesatma-server
andAtma Toolkit
with aHTTPHandler
to serve compiled sources (with sourceMap support)
For usage examples refer to:
API
create
module.exports.create = function(data, ICompiler):AtmaPlugin
/*
* - data Object {
* name: String > Plugin Loader Name
* options: {
* mimeType: String > mimeType of the resource
* extensions: [String] > file extensions to bind the middleware to
* ... > other configuration, which is then passed to compiler
* }
* }
*
* - ICompiler Object {
* compile: function(source String, filepath String, config Object): ICompilationResult
* ?compileAsync: function(source, filepath, config): Deferred<ICompilationResult>
* }
*
* ICompilationResult: {
* content: String > Should contain compiled result
* ?sourceMap: String > optional, Source Maps
* }
*/
options
could be extended then via package.json
. Example:
{
"atma": {
"settings": {
"%loader-name%": {
"foo": "baz"
}
}
}
}
(c) MIT License - Atma.js Project