GithubHelp home page GithubHelp logo

ignite's Introduction

Ignite

Ignite is a framework that allows for management of JavaScript, style sheets (CSS, LESS) and JavaScript templates for ASP.NET MVC3.

Quick Start

  1. Install using NuGet: PM> Install-Package Ignite

  2. Configure your Global.asax.cs:

    public static void RegisterRoutes(RouteCollection routes)
    {
        PackageContainer.Create()                   // Create a new package container.
            .JavaScript("core", new[]               
            { 
                "js/vendor/underscore-1.3.1.js",    // Add individual files
                "js/vendor/backbone*.js",           // or using wildcards
                "js/app/**/*.js",                   // or recursive search.
                "js/templates/*.jst"                // You can even add your templates!
            })
            .StyleSheet("core", new[]
            {
                "style/**/*.less"                   // The default stylesheet compressor uses DotLess.
            })
            .Map(routes);                           // Let MVC handle requests to these routes.
    
        // Other routes would go here...
    }
  3. Tell the view to render these tags:

    @using Ignite;
    <!DOCTYPE html>
    <html>
      <head>
        <title>Testing Ignite</title>
        @PackageContainer.JavaScriptTag("core")
        @PackageContainer.StyleSheetTag("core")
  4. Run the application in Debug mode (or call EnableDebugging() on the container) and view the source:

    <!DOCTYPE html>
    <html>
      <head>
      <title>Testing Ignite</title>
        <script type="text/javascript" src="/assets/core.js?debug=js/vendor/underscore-1.3.1.js"></script>
        <script type="text/javascript" src="/assets/core.js?debug=js/vendor/backbone-0.9.1.js"></script>
        <script type="text/javascript" src="/assets/core.js?debug=js/app/1.js"></script>
        <script type="text/javascript" src="/assets/core.js?debug=js/app/2.js"></script>
        <script type="text/javascript" src="/assets/core.js?debug=js/app/3.js"></script>
        <script type="text/javascript" src="/assets/core.js?debug=templates/f1e24613-dc84-4653-bb02-244702e86c17.js"></script>
        <link rel="stylesheet" type="text/css" href="/assets/core.css?debug=style/lib.less" />
        <link rel="stylesheet" type="text/css" href="/assets/core.css?debug=style/test.less" />

    Ignite is nice enough to render individual tags for each asset to aid in easy debugging.

  5. Run the application in Release mode (or call DisableDebugging() on the container) and view the source:

    <!DOCTYPE html>
    <html>
      <head>
        <title>Testing Ignite</title>
        <script type="text/javascript" src="/assets/core.js?v=3fa224672904"></script>
        <link rel="stylesheet" type="text/css" href="/assets/core.css?v=9b6e23712485" />
  6. Check out the wiki for detailed configuration such as templates and caching!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.