bundling-and-minification

ASP.NET MVC4 Bundle a single file

时光毁灭记忆、已成空白 提交于 2019-12-04 18:54:37
问题 Is there a way to bundle a single file using the new bundling features in MVC4? I know bundling a single file doesn't make much sense but I'd like to use server-side minification and let MVC append a hash on to the end of the URL for caching purposes. I've tried the @Scripts.Url("~/Scripts/myscript.js") but it doesn't appear to work. 回答1: Well, define a bundle containing only this file in your bundle config: bundles.Add( new ScriptBundle("~/bundles/myscript").Include("~/Scripts/myscript.js")

Is there any way to have a file extension in a bundle name?

一笑奈何 提交于 2019-12-04 17:40:24
问题 I would like to have define a bundle like this: bundles.Add( new StyleBundle("~/style.css").Include( //... )); If the bundle name is just "~/style" this works, but with the file extension it always returns a 404. I suspect the server searches for CSS and JS files on the drive and ignores the bundling system, but I can't find anyone else who is trying to include file extensions in bundle names. Is this possible to do without something like a URL rewrite? 回答1: You could add the following to

With Firebase Hosting how do I turn off bundling and minification?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 17:31:44
I am pleased with how quickly I can get my AngularJS and Firebase app deployed to Firebase Hosting, but it appears that local CSS and JavaScript files are bundled and minified as part of executing $firebase deploy I would like to debug the JavaScript after deploying. How do I turn off bundling and minification as part of the deploy? We're currently in beta and this is something we will be implementing soon but I'm afraid at this time it's not possible to turn off the minification and bundling on deploy. We've just removed the minification step from the processing we do on the uploaded files so

Webpack: How do I bundle multiple javascript files into a single output file?

时光总嘲笑我的痴心妄想 提交于 2019-12-04 13:27:47
问题 Suppose I have two files, main.js and app.js ; how do I use Webpack to bundle both of them into one file: bundle.js ? 回答1: create one entry.js which is your webpack entry file and in this your require your additional files webpack.config.js module.exports = { entry: './src/entry.js' ... }; /src/entry.js require('./main.js'); require('./app.js'); if these two files depend on each other, it would be be beneficial to reflect this in your dependency tree and require main.js in your app.js and not

Minification for ES6 code in webpack using babel

本秂侑毒 提交于 2019-12-04 11:58:50
问题 I have tried options such as Uglifyjs,babelli (babel-minify ).nothing seems to be working.Uglify throws some error like this: Name expected [au680.bundle.js:147541,22] babelli does not minifies the code either.Can any one give simple example of es6 minification making use of webpack 2, babel. May be a plugin that do the work cleanly. var path = require('path'); var webpack = require('webpack'); var HtmlWebpackPlugin = require('html-webpack-plugin'); var AppCachePlugin = require('appcache

System.Web.Optimization changes order of js files when minifying javascript

戏子无情 提交于 2019-12-04 11:50:59
I am observing a very peculiar behaviour when minifying files with System.Web.Optimization , I am already using IBundleOrderer that works fine in preserving file order when I am not minifying the files public class RespectGivenBundleOrder : IBundleOrderer { public IEnumerable<BundleFile> OrderFiles(BundleContext context, IEnumerable<BundleFile> files) { return files; } } public static void RegisterTestingBundle(BundleCollection bundles) { var bundle = new ScriptBundle("~/OnTheMoveWebFiles/bundles/Testing"); bundle.Orderer = new RespectGivenBundleOrder(); bundle.Include( string.Format("{0

Visual Studio 2012 Conditional Bundling

我只是一个虾纸丫 提交于 2019-12-04 10:17:07
问题 I just began working with VS 2012 RC. I've created a test site with a master page and a single web form. Currently, I'm using this code to bundle the entire Styles folder on the site: Global.asax BundleTable.Bundles.EnableDefaultBundles(); Site.master <link rel="stylesheet" type="text/css" href="Styles/css" /> Question: The test site has a site-level CSS file that controls the overall look and feel of the site. In addition to the site-level CSS, each page could have their own CSS definitions.

What is the proper use of IItemTransform for correcting paths in CSS Bundling with ASP.NET Web Optimization and BundleTransformer?

梦想与她 提交于 2019-12-04 07:19:52
I'm presently working on a project that uses the ASP.NET Web Optimization library (v 1.1.0-Beta1) in conjunction with the Bundle Transformer extension (v 1.7.3-Beta1 for core, 1.7.0-Beta1 for LESS) which is used to convert LESS into CSS. Based on web searches paths within CSS (and less) appear to be a common issue, in most cases it is recommended to manually modify the CSS and be done with it. However, due to differences between our development and production environment, and not owning the affected CSS such a solution is not feasible. Two solutions seem to exist. The first is to overlay the

Manually bundle and minify JS from a controller action

纵然是瞬间 提交于 2019-12-04 06:38:04
I love Bundling and Minification in ASP.NET MVC 4.5 and use it a lot. However, one small problem is that our "plugins" are hosted on a cookieless domain, which is in a separate project in my Visual Studio solution. I'm looking for a solution that'll allow our main site to request a bundled and minified JS file containing any number of our plugins from the cookieless site. Something like: http://my.cookieless.domain/plugins.js?include=alpha&include=bravo,charlie So far, the best solution I can find is to use a 3rd party bundling and minification library, which seems like overkill considering

AngularJS not working in release mode (minified)

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 04:34:01
I have AngularJS, and Angular directives for Bootstrap in a project, both of which have been added via Nuget. When compilation debug="true" , everything works fine, but once I change compilation debug to false , Angular stops working, and I get the following error in Chrome's console: Error: [$injector:unpr] http://errors.angularjs.org/1.2.15/$injector/unpr?p0=nProvider%20%3C-%20n at Error (native) at http://localhost:10366/bundles/angular?v=Bi8OwYOhmsGdeIKC46ZQQdIHX1faTIVR48lG9QG3GBw1:1:448 at http://localhost:10366/bundles/angular?v=Bi8OwYOhmsGdeIKC46ZQQdIHX1faTIVR48lG9QG3GBw1:1:14726 at