Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

atma-loader

tenbits11MIT1.0.11

Base Atma Loader

readme

Atma Loader Abstraction

Used for the atma plugin creation to develop File read middleware, like compilers and preprocessors.

Extends:

  • IncludeJS with a custom loader
  • atma-io with a custom middleware to read/compile/preprocess files
  • atma-server and Atma Toolkit with a HTTPHandler 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