0

I have CSS files in a folder and I am planning to minify them usign cassette So far

I have created a class

    public class CSSBundleHelper : IConfiguration<BundleCollection>
    {
        public void Configure(BundleCollection bundles)  
        {
            var BundlePath =      ConfigurationManager.AppSettings["CSSBundleFolder"];
        var path = ConfigurationManager.AppSettings["CMSSitesPath"];
        bundles.AddPerSubDirectory<StylesheetBundle>(path);
        }
    }
}
  • What should I pass for the bundle Collection?

  • List item

    Since the CSS files are in a folder , do I need to pass them using absolute path or a relative path ?

Since the files are in a folder, i do not have an Idea how to call to this function and do the bundling . I will be happy if someone can guide me

1 Answer 1

1

If your css files are in one folder, just pass an application-relative path to bundles.Add(path-to-css-folder)

Then to use this bundle i.e. in Razor: add @Bundles.RenderStyleSheets()

Sign up to request clarification or add additional context in comments.

3 Comments

The thing is those css file wont use by the application it self, used by other websites .
Then why not do the bundling from the other websites?
well cannot do that since its not the requirement . Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.