bundling-and-minification

Angular2 TypeScript transpiler with Minification / Uglify

梦想的初衷 提交于 2019-12-02 04:34:07
I'm developing a web application in Visual Studio 2015 with Angular2 and TypeScript . I'm using Gulp to generate distributed minified js files. With Angular2 I see, that there is no need to transpile TypeScript neither with Visual Studio nor with Gulp as SystemJs does it when importing the module. Now is the question: How does SystemJs work with minification, uglification and so on? System.import('app/main').then(null, console.error.bind(console)); How do I minify or uglify this? Thierry Templier SystemJS is Universal dynamic module loader - loads ES6 modules, AMD, CommonJS and global scripts

bundling is turned off but I still want versioning

此生再无相见时 提交于 2019-12-02 02:01:28
问题 I am using bundling in MVC4, or rather I was using bundling but have had to turn it off. This means the script and style links are just rendered on separate lines and have no version string to make sure browsers download the latest file if there is an update. I have tried adding a version string in the bundling code but I then get an error saying the path is invalid. Is there a way of applying versioning to bundled script files that have had bundling turned off? 回答1: Here is one way to do

When using the YUI compressor, should I combine then minify, or minify then combine?

瘦欲@ 提交于 2019-12-01 19:25:15
问题 I've read some people saying there can be issues if you combine and then minify, and that you should always minify then combine (See for example the comments on this question.) However, I've never seen an example of what these issues are or encountered them myself. I also can't find anything official from the YUI devs stating what the best practice is. 回答1: Due to the way compression algorithms work, combining and then minifying should give us the best results. GZIP compression Currently the

ASP.NET bundling/minification: including dynamically generated Javascript

三世轮回 提交于 2019-12-01 15:33:27
I have a site that dynamically generates Javascript. The generated code describes type-metadata and some server-side constants so that the clients can easily consume the server's services - so it's very cacheable. The generated Javascript is served by an ASP.NET MVC controller; so it has a Uri; say ~/MyGeneratedJs . I'd like to include this Javascript in a Javascript bundle with other static Javascript files (e.g. jQuery etc): so just like static files I want it to be referenced separately in debug mode and in minified form bundled with the other files in non-debug mode. How can I include

How to disable bundling in Webpack for development?

旧城冷巷雨未停 提交于 2019-12-01 15:30:18
In my web app I was using RequireJS to asynchronously load my javascript files on demand. This worked well for dev - when debugging my app I could see which script is dependent on which and order in which they were loaded. This simplified debugging. Later I switched to Webpack as it is much easier in configuration and easier to maintain. So Webpack now generates for me nice bundles containing my javascript code. This works perfectly well but what I'd like to have is an imitation of my previous RequireJS configuration for dev time. When I am developing my app I want Webpack to generate some

ASP.NET bundling/minification: including dynamically generated Javascript

做~自己de王妃 提交于 2019-12-01 14:30:23
问题 I have a site that dynamically generates Javascript. The generated code describes type-metadata and some server-side constants so that the clients can easily consume the server's services - so it's very cacheable. The generated Javascript is served by an ASP.NET MVC controller; so it has a Uri; say ~/MyGeneratedJs . I'd like to include this Javascript in a Javascript bundle with other static Javascript files (e.g. jQuery etc): so just like static files I want it to be referenced separately in

MVC bundeling : Err 403

我的梦境 提交于 2019-12-01 03:04:06
Using VS'12, Asp.net - C# - InternetApplication Template, KendoUI, EF Code First This is my MVC BundleConfig.cs bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css")); // The Kendo CSS bundle bundles.Add(new StyleBundle("~/Content/kendo").Include( "~/Content/kendo/kendo.common.*", "~/Content/kendo/kendo.default.*")); // The Kendo JavaScript bundle// or kendo.all.min.js if you want to use Kendo UI Web and Kendo UI DataViz bundles.Add(new ScriptBundle("~/bundles/kendo").Include( "~

Running an ASP.NET MVC 4 app in release mode does not bundle and minifiy the js files

我是研究僧i 提交于 2019-12-01 02:35:10
When I run my ASP.NET MVC 4 app in release mode, the bundles are still outputting the unminified and separate js files, instead of bundling and minifying it into fewer bundled JavaScript files. Any ideas? FYI, release config: <?xml version="1.0"?> <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <system.web> <compilation xdt:Transform="RemoveAttributes(debug)" /> </system.web> </configuration> Thanks to aleyush's comment that Web.release.config is only used during publishing the app, and not when running it locally, I was able to fix it by adding the following

Absolute URL in ASP bundle

北城余情 提交于 2019-12-01 02:17:46
I use a jQuery library for Google Maps, and it depends on the Google scripts to be loaded first. I'd like to be able to include both in the bundle as such: bundles.Add(new ScriptBundle("myfoobundle").Include( "http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places", "~/scripts/jquery.fooplugin-{version}.js" )); This doesn't seem to work (throws an exception complaining about the first string). And one may say that this shouldn't work because that absolute URL is not meant to be minified/bundled. But the current approach is a hassle, as I need to ensure that the dependencies are

Angular-cli : How to ignore class names from being minified

前提是你 提交于 2019-12-01 01:21:38
问题 For an application we need to keep the classname not minified because we use var className = myObject.constructor.name; export class myObject{ ... } when we run ng build -- pro the class name gets minified in a random name. 回答1: Angular cli uses webpack and uglify internally. One solution would be changing the options in uglify by exporting the webpack configuration. You can see the webpack files by running ng eject, and ng eject --prod new UglifyJsPlugin({ "mangle": false, "compress": {