Sitecore Bundler

  0 rating
11/1/2017 9:00:20 AM
11/22/2017 10:46:10 AM
Source: Git Repository
Provider: Rodrigo Peplau

About

 

With this module you can easily manage your Javascript and CSS references. You can setup different configurations for your multiple websites and Layouts, everything convenently managed as Sitecore items.

This module makes use of the CdnBundle Library for the execution of Minification and Bundling, and implements a layer of configurable caches, message logging and distribution of bundles for multiple websites and Layouts.

Documentation

Documentation
  • Documentation > Installation
    Installation

    • Install the package at your Sitecore installation using the Installation Wizard
    • In a scaled environment you must make sure to either re-install the package at each instance (CM and CDs) or manually deploy the files

    Files to deploy

    • App_Config/Include/Sitecore.Bundle.config
    • bin/AjaxMin.dll
    • bin/CdnBundle.dll
    • bin/SitecoreBundler.dll
    0
  • Documentation > Installation
    Setup Instructions - Global Bundler

      If you want to have a single Bundler for your whole sitecore installation:

      1. At Content Editor, anywhere under the Content Tree, create a new item of template /sitecore/templates/Sitecore Bundler/Bundler

      2. Follow instructions below  for Multiple Bundlers - steps 2 to 6

      3. Open config file \App_Config\Include\Sitecore.Bundler.config and add the ID of your global Bundler to the setting Bundler.GlobalBundlerItem


      0
    • Documentation > Setup Instructions - Multiple Bundlers
      Setup Instructions - Multiple Bundlers

       


      1. At Content Editor, somewhere under your Website root node create a new item of template /sitecore/templates/Sitecore Bundler/Bundler

      2. This default configuration will apply to all Layouts under that website, will create bundled files under ~/bundle and will NOT Bundle, Minify or apply Agressive Cache. Change these fields if you want to modify bundle settings.

      3. Right click your new Bundler and insert a Javascript or a Css Bundler, according to your bundler type - Each of these can be later referenced at your Layout

      4. At your new JS or CSS Bundler, add your references to the Bundles field, one each line
        1. Add your references as you would do at the markup. Eg: <link rel="stylesheet" type="text/css" href="/Css/vendor.min.css" />
        2. You can add either Local or External (CDN) references

      5. Still at your new JS or CSS Bundler, type a name for the file, with or without an extension (Eg: styles-min.css)

      6. For each JS or CSS bundle you want to register, repeat steps 3 to 5. Eg: You can have one Javascript bundler for your local files being bundled and minified, while your external CDN files will be referenced as is by a second Javascript bundler.

      7. If you want to have different bundles to the different Layouts of your website, repeat all this steps for each of your Layouts

       

      2
    • Documentation > Usage instructions at Layouts
      Usage instructions at Layouts

      At your Layout View:
      1. Add a reference to Sitecore Bundler
        @using SitecoreBundler

      2. Render your bundles 
        @Html.Sitecore().Bundle("styles-min.css")

        

      3
    • Documentation > Test Instructions - Debug Mode
      Test Instructions - Debug Mode

       

      The Debug Mode can be turned on and off at the Sitecore.Bundler.config file, Bundler.DebugMode setting, which by default is turned on.

      1. Run the page and watch your Bundle Local Paths for the new files that will be created;

      2. Change Bundle settings and test again (Eg: Check fields Bundle, Minify and Agressive Cache)
        1. Every time you update these values the whole bundle is deleted and re-created

      3. The module will log some statistics - Please check your Log files to see how fast things are loading.

       

      4
    Back
    Release notes
    - v0.6 - Initial Release
    Read more Back
    Code examples

    Solution screenshots(0)

    Upload

    Reviews (0)

    Sort by: Date Most votes
    • Profile Avatar
      [fullName]

      Level: 0

      x0 x0 x0

      [date]

      [title]

      [text]

      Was this helpful?

      0

    Comments (0)

    Sort by: Date  Most votes

    Leave a Comment

    Comment must be field in
    Post comment
    loader

    Write a review

    Title can't be empty
    Review can't be empty
    Post review

    Download

    Title Description Download Action

    Add File