enb-css-hash

0.0.1 • Public • Published

enb-css-hash

ENB tech to build a hash with entities as a key and array of CSS strings collected from all the levels as a value.

NPM version Build Status Coverage Status Dependency Status

Default result is css.json file with something like this:

{
    "b1": [".b1 { color: red; }", ".b1 { font-size: 42px; }"],
    "b2": [".b2 { color: green; }"]
}

Installation

Install enb-css-hash package:

$ npm install --save-dev enb-css-hash

Requirements: enb 0.16.0+.

Quick start

module.exports = function(config) {
    config.nodes('*.bundles/*', function(nodeConfig) {
        nodeConfig.addTechs([
            [require('enb-css-hash'), {
                sourceSuffixes: ['css'],
                target: 'css.json',
                processor: function(filename) {
                    console.log(this._processorOptions); // { life: 42 }
                    return fs.readFileSync(filename, 'utf8');
                },
                processorOptions: {
                    life: 42
                }
            }]
        ]);
    });
};

License

© 2017 YANDEX LLC. Code released under the Mozilla Public License 2.0.

Readme

Keywords

none

Package Sidebar

Install

npm i enb-css-hash

Weekly Downloads

1

Version

0.0.1

License

none

Last publish

Collaborators

  • tadatuta