How to use the assetgraph.transforms function in assetgraph

To help you get started, we’ve selected a few assetgraph examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github assetgraph / assetgraph-builder / lib / transforms / index.js View on Github external
var _ = require('underscore');

// Start with AssetGraph's built-in transforms:

var builtIn = require('assetgraph').transforms;

Object.keys(builtIn).forEach(function (transformName) {
    exports.__defineGetter__(transformName, function () {
        return builtIn[transformName];
    });
});

// Install getters for all transforms in this directory:

require('fs').readdirSync(__dirname).forEach(function (fileName) {
    if (/\.js$/.test(fileName) && fileName !== 'index.js') {
        exports.__defineGetter__(fileName.replace(/\.js$/, ''), function () {
            return require('./' + fileName);
        });
    }
});

assetgraph

An auto discovery dependency graph based optimization framework for web pages and applications

BSD-3-Clause
Latest version published 4 months ago

Package Health Score

62 / 100
Full package analysis

Similar packages