cassette icon indicating copy to clipboard operation
cassette copied to clipboard

Minify is still happening in spite of pipeline modification

Open rodmjay opened this issue 11 years ago • 1 comments

I am struggling with an issue for about a day now. We are using the Cassette.Less package to bundle a less file. The problem I'm seeing is that when I bundle this way..

    public void Configure(BundleCollection configurable)
    {
        configurable.Add<StylesheetBundle>("content/less/site.less", RemovePipeline);
    }

    void RemovePipeline(StylesheetBundle b)
    {
        var x = b.Pipeline.IndexOf<MinifyAssets>();
        if (b.Pipeline.IndexOf<MinifyAssets>() > 0)
            b.Pipeline.RemoveAt(x);

        var a = b.Pipeline.IndexOf<ConcatenateAssets>();
        if (b.Pipeline.IndexOf<ConcatenateAssets>() > 0)
            b.Pipeline.RemoveAt(a);
    }

The it still comes out minified. Seems there is something else that is performing minification on the resources outside of the pipeline for the bundle. When debug=true, this does not happen, and the file is rendered without minification.

rodmjay avatar Sep 19 '13 16:09 rodmjay

My guess is this is due to caching. Cassette caches the output of a bundle to avoid having to re-run the processing when the app starts each time.

To test this, first tell Cassette to cache files somewhere you can access e.g. relative to your app's directory. In web.config:

<cassette cacheDirectory="cassette-cache"/>

Now see if clearing the cache (by deleting the files) and restarting the app fixes the problem.

andrewdavey avatar Sep 19 '13 17:09 andrewdavey