2.0.2 • Published 2 years ago

gridfw-compiler v2.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
2 years ago

gridfw-compiler

Compile sources files for gridfw

Compile js templates

// use default options
gulp.src(...)
    .pipe( GfwCompiler.template({params}) )

Compile views

By default, The the framework supports "pug" files

// use default options
compiler.views()

To support an other engine, add the code that will compile each file mapped by the file extension. Example:

// use default options
compiler.views({
    engines: {
        // fileExtension: function(content, options){}
        pug: function(content, options){
            // compile content
            content = Pug.compileClient(content, {
                pretty: options.pretty,
                filename: options.filename,
                name: 'template' // result function name
            });
            // export data
            return content + "\nmodule.exports = template";
        },
        ejs: function(content, options){
            // compile content
            content = EJS.compile({
                pretty: options.pretty,
                filename: options.filename,
                client: true, // render client function
            });
            // export data
            return "module.exports = " + content.toString();
        }
    }
})

Supporters

coredigix

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

3 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago