Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 1.1 KB

README.md

File metadata and controls

34 lines (27 loc) · 1.1 KB

AF Compiler Codacy Badge

This compiler compiles any project that targets a JavaScript runtime. Other files than source code, like sass or less, can also be required and compiled in your project, even though it's not recommended.

The compiler is able to be used in a gulp .pipe(), but it is not required to use it that way. (Don't .pipe(Gulp.dest(...)) since the compiler will already write the resulting bundles.)

Installation

npm i --save-dev @af-modules/compiler

How to use

const compilerBuilder = require('@af-modules/compiler');

const compilerConfig = { 
    cacheDir: '.cache/', 
    compilers: ['js'],
    extensions: ['js'],
    linkExtensions: ['js'], 
    outDir: 'dist/',
};

const compiler = compilerBuilder(compilerConfig);

compiler({
    module: 'app',
    entry: 'src/app.js',
    context: 'src/',
    target: 'web',
});