Exemplo n.º 1
0
        public static void RegisterBundles(BundleCollection bundles)
        {
            var css = new CustomStyleBundle("~/Css/lib");

            css.Include("~/Content/Css/Bootstrap/bootstrap.less");
            css.Include("~/Content/Css/Fontawesome/css/font-awesome.css");
            css.IncludeDirectory("~/Content/Css/Plugins", "*.css");
            css.Include("~/Content/ed3d/css/styles.css");
            css.IncludeDirectory("~/Content/Css", "*.less");
            css.Orderer = new NullOrderer();
            bundles.Add(css);

            var js = new CustomScriptBundle("~/Js/lib");

            js.Include("~/Content/Js/lib/jquery.min.js");
            js.Include("~/Content/Js/lib/angular.min.js");
            js.Include("~/Content/Js/lib/moment.min.js");
            js.Include("~/Content/Js/lib/jquery.wysibb.min.js");
            js.Include("~/Content/Js/lib/ng-tags-input.js");
            js.Include("~/Content/Js/lib/ng-google-chart.js");
            js.Include("~/Content/Js/lib/checklist-model.js");
            js.Include("~/Content/Js/lib/jquery.easy-autocomplete.min.js");
            js.Include("~/Content/Js/app.js");
            js.IncludeDirectory("~/Content/Js/Controllers", "*.js");
            js.IncludeDirectory("~/Content/Js/Directives", "*.js");
            js.Orderer = new NullOrderer();
            bundles.Add(js);

#if !DEBUG
            BundleTable.EnableOptimizations = true;
#endif
        }
Exemplo n.º 2
0
        public static void Register(BundleCollection bundles)
        {
            var nullOrderer = new NullOrderer();

            // styles
            var cssBundle = new CustomStyleBundle("~/bundles/css");

            cssBundle.Include(
                "~/Content/normalize.css",
                "~/Content/angular-ui.css",
                "~/Content/angular-snap.css",
                "~/Content/JQuery/jquery-ui-{version}.custom.css",
                "~/Content/Kendo/2014.1.318/kendo.common.min.css",
                "~/Content/Kendo/2014.1.318/kendo.silver.min.css",
                "~/Content/loading-bar.min.css",
                "~/Content/font-awesome.css");
            cssBundle.Orderer = nullOrderer;
            bundles.Add(cssBundle);

            // modernizr
            var modernizrBundle = new CustomScriptBundle("~/bundles/modernizr");

            modernizrBundle.Include("~/Scripts/modernizr-{version}.js");
            modernizrBundle.Orderer = nullOrderer;
            bundles.Add(modernizrBundle);

            // scripts
            var scriptsBundle = new CustomScriptBundle("~/bundles/scripts");

            scriptsBundle.Include(
                "~/Scripts/jquery-{version}.js",
                "~/Scripts/angular.js",
                "~/Scripts/underscore.js",
                "~/Scripts/kendo/2014.1.318/kendo.web.min.js",
                "~/Scripts/jquery-ui-{version}.custom.js",
                "~/Scripts/jquery.signalR-2.1.1.min.js",
                "~/Scripts/snap.js",
                "~/Scripts/angular-kendo.js",
                "~/Scripts/angular-ui.js",
                "~/Scripts/angular-snap.js",
                "~/Scripts/angular-resource.js",
                "~/Scripts/angular-route.js",
                "~/Scripts/angular-signalr-hub.js",
                "~/Scripts/angular-cookies.js",
                "~/Scripts/bindonce.js",
                "~/Scripts/timepicker-addon.js",
                "~/Scripts/Moment.js",
                "~/Scripts/loading-bar.min.js",
                "~/Scripts/sortable.js",
                "~/Scripts/jquery.inputmask.bundle.js",
                "~/Scripts/jquery.inputmask.extensions.js",
                "~/Scripts/jquery.ui.touch-punch.js");
            scriptsBundle.Orderer = nullOrderer;
            bundles.Add(scriptsBundle);

            // app
            var appBundle = new CustomScriptBundle("~/bundles/app");

            appBundle
            .IncludeDirectory("~/App/Common", "*.js", true)
            .IncludeDirectory("~/App/Home", "*.js", true)
            .IncludeDirectory("~/App/DataEntry", "*.js", true)
            .IncludeDirectory("~/App/SystemAdmin", "*.js", true)
            .IncludeDirectory("~/App/Workflow", "*.js", true)
            .IncludeDirectory("~/App/Template", "*.js", true)
            .IncludeDirectory("~/App/Query", "*.js", true)
            .Include("~/App/main.js");
            appBundle.Orderer = nullOrderer;
            bundles.Add(appBundle);

            // less
            var lessBundle = new CustomStyleBundle("~/bundles/less");

            lessBundle.Include("~/Content/Less/main.less");
            lessBundle.Orderer = nullOrderer;
            bundles.Add(lessBundle);

            // Combined script bundle for unauthenticated consumption by the Classic app area.
            // Note: Please don't reference any scripts here that we wouldn't be OK with exposing over the public Internet.
            var classicScriptBundle = new CustomScriptBundle("~/bundles/classic/scripts");

            classicScriptBundle
            .Include(
                // Libs
                "~/Scripts/modernizr-{version}.js",
                "~/Scripts/jquery-{version}.js",
                "~/Scripts/angular.js",
                "~/Scripts/underscore.js",
                "~/Scripts/kendo/2014.1.318/kendo.web.min.js",
                "~/Scripts/jquery-ui-{version}.custom.js",
                "~/Scripts/snap.js",
                "~/Scripts/angular-kendo.js",
                "~/Scripts/angular-ui.js",
                "~/Scripts/angular-snap.js",
                "~/Scripts/angular-resource.js",
                "~/Scripts/angular-route.js",
                "~/Scripts/bindonce.js",
                "~/Scripts/timepicker-addon.js",
                "~/Scripts/Moment.js",
                "~/Scripts/loading-bar.min.js",
                "~/Scripts/sortable.js")
            // App
            .IncludeDirectory("~/Classic/App/Common", "*.js", true)
            .IncludeDirectory("~/Classic/App/Controllers", "*.js", true)
            .IncludeDirectory("~/Classic/App/Directives", "*.js", true)
            .IncludeDirectory("~/Classic/App/Services", "*.js", true)
            .IncludeDirectory("~/Classic/App/Launch/Controllers", "*.js", true)
            .IncludeDirectory("~/Classic/App/Launch/Directives", "*.js", true)
            .Include("~/Classic/App/main.js");
            classicScriptBundle.Orderer = nullOrderer;
            bundles.Add(classicScriptBundle);

            // Combined style bundle for unauthenticated consumption by the Classic app area.
            // Note: Please don't reference any stylesheets here that we wouldn't be OK with exposing over the public Internet.
            var classicStyleBundle = new CustomStyleBundle("~/bundles/classic/styles");

            classicStyleBundle.Include(
                // 3rd-party
                "~/Content/normalize.css",
                "~/Content/angular-ui.css",
                "~/Content/angular-snap.css",
                "~/Content/JQuery/jquery-ui-{version}.custom.css",
                "~/Content/Kendo/2014.1.318/kendo.common.min.css",
                "~/Content/Kendo/2014.1.318/kendo.silver.min.css",
                "~/Content/loading-bar.min.css",
                "~/Content/font-awesome.css",

                // App
                "~/Content/Less/main.less");
            classicStyleBundle.Orderer = nullOrderer;
            bundles.Add(classicStyleBundle);
        }
Exemplo n.º 3
0
        public static void RegisterBundles(BundleCollection bundles)
        {
            // bundles.IgnoreList.Clear();
            //  AddDefaultIgnorePatterns(bundles.IgnoreList);
            //NOTE: it's bundles.DirectoryFilter in Microsoft.AspNet.Web.Optimization.1.1.3 and not bundles.IgnoreList

            var engine = new V8JsEngine();

            var uglySettings = new UglifySettings();

            uglySettings.Js.CodeGeneration.Beautify = true;

            bundles.UseCdn = false;

            var uglifyJsMinifier = new UglifyJsMinifier(() => engine, uglySettings)

            {
                CompressionOptions = { Angular = true },
                ParsingOptions     = new ParsingOptions {
                    Strict = true
                },
                CodeGenerationOptions = new CodeGenerationOptions()
            };


            var lessTranslator = new LessTranslator();

            var cssTransformer = new CssTransformer(new CleanCssMinifier(), new ITranslator[] { lessTranslator });

            var tsTranslater = new TypeScriptTranslator();

            var jsTransformer = new JsTransformer(uglifyJsMinifier, new List <ITranslator> {
                tsTranslater
            });

            var jsBundle = new CustomScriptBundle("~/bundles/js");

            jsBundle.IncludeDirectory("~/scripts", "*.js", true);
            jsBundle.IncludeDirectory("~/scripts", "*.map", true);

            bundles.IgnoreList.Ignore("angular-mocks.js");
            bundles.IgnoreList.Ignore("angular-scenario.js");

            //   jsBundle.IncludeDirectory("~/scripts/angular-dialog-service-5.1.2", "*.js", true);

            jsBundle.Builder = new DefaultBundleBuilder();

            jsBundle.Orderer = new JsBundlerOrderer();

            jsBundle.Transforms.Add(jsTransformer);

            bundles.Add(jsBundle);


            var typeScriptBundle = new CustomScriptBundle("~/bundles/ts");    //// Typescript generatred locally via visual studio and checked in - not done on the fly

            typeScriptBundle.IncludeDirectory("~/app", "*.js", true);

            typeScriptBundle.Transforms.Add(jsTransformer);

            typeScriptBundle.Builder = new DefaultBundleBuilder();

            typeScriptBundle.Orderer = new JsBundlerOrderer();

            bundles.Add(typeScriptBundle);


            var lessCssBundle = new Bundle("~/bundles/less");

            lessCssBundle.Include("~/Content/bootstrap/bootstrap.less");

            lessCssBundle.Builder = new DefaultBundleBuilder();

            lessCssBundle.Transforms.Add(cssTransformer);

            lessCssBundle.Orderer = new DefaultBundleOrderer();

            bundles.Add(lessCssBundle);

            var cssBundle = new StyleBundle("~/bundles/css");

            cssBundle.IncludeDirectory("~/Content/Bootstrap", "*.css", false);
            cssBundle.IncludeDirectory("~/Content/", "*.css", false);
            cssBundle.IncludeDirectory("~/Content/css", "*.css", false);

            cssBundle.Builder = new DefaultBundleBuilder();

            cssBundle.Transforms.Add(cssTransformer);

            cssBundle.Orderer = new PushToTopOrderer("bootstrap");

            bundles.Add(cssBundle);

            var publicCssBundle = new StyleBundle("~/bundles/public/css");

            publicCssBundle.IncludeDirectory("~/Content/public", "*.css", true);
            publicCssBundle.Builder = new DefaultBundleBuilder();
            publicCssBundle.Transforms.Add(cssTransformer);
            publicCssBundle.Orderer = new PushToTopOrderer("bootstrap");
            bundles.Add(publicCssBundle);
        }