BlessCSS / bless

CSS Post-Processor
blesscss.com
MIT License
282 stars 60 forks source link

Documentation on API change #105

Open gilligan opened 8 years ago

gilligan commented 8 years ago

I just reviewed a greenkeeper PR that upgraded bless to the latest version in our project:

TypeError: bless.Parser is not a constructor
    at projects/foobar/scripts/optimizeStylesheetForIE.js:43:47
    at Array.forEach (native)
    at Compilation.<anonymous> (projects/foobar/scripts/optimizeStylesheetForIE.js:40:26)
    at Compilation.next (projects/foobar/node_modules/tapable/lib/Tapable.js:69:14)
    at displayAssetsReadiness (projects/foobar/node_modules/webpack-quotes/index.js:36:5)
    at Compilation.<anonymous> (projects/foobar/node_modules/webpack-quotes/index.js:64:13)
    at Compilation.applyPluginsAsync (projects/foobar/node_modules/tapable/lib/Tapable.js:71:13)
    at Compilation.<anonymous> (projects/foobar/node_modules/webpack/lib/Compilation.js:572:10)
    at Compilation.applyPluginsAsync (projects/foobar/node_modules/tapable/lib/Tapable.js:60:69)

Previously bless was invoked as shown below:

Object.keys(assets)
    .filter(isCssAsset)
    .forEach(function (name) {
        var ieFileName = name.replace('.css', '_ie.css'),
            filePath = name.replace('./', './build/assets/'),
            blessParser = new bless.Parser({ output: ieFileName, options: {} });

        copyFile(assets[name].source(), filePath);

        blessParser.parse(assets[name].source(), parseContent);
    });

Could you possibly provide some sort of upgrade documentation that would help to adapt this code to the latest release? That would be great.