bundling-and-minification

How to disable bundling in Webpack for development?

此生再无相见时 提交于 2019-12-04 02:55:43
问题 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

How to resolve Antlr3 dependency hell

橙三吉。 提交于 2019-12-04 00:33:51
I have a asp.net MVC 4 project with MEF and RavenBD. When the project loads it throws this exception : Could not load file or assembly Antlr3.Runtime.dll I have found that both RavenDB and WebGrease (installed with MVC 4) use Antlr3. But WebGrease comes with its own Antlr3 dll, signed by Microsoft - PublicKeyToken 31bf3856ad364e35 Antlr3 default PublicKeyToken is eb42632606e9261f. RavenDB and WebGrease use the same version of Antlr3 3.3.1.7705 How can I resolve this problem? Unfortunately I did not found a solution to conflicting dependencies of same version with different signatures. But the

Absolute URL in ASP bundle

本小妞迷上赌 提交于 2019-12-03 23:27:09
问题 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

How to add media attribute to ASP.NET MVC4 style bundle

。_饼干妹妹 提交于 2019-12-03 22:43:41
In ASP.NET MVC4 application, style bundle is created using bundles.Add(new StyleBundle("~/css/pos.css") .Include("~/css/mypos.css")); and rendered in view as @Styles.Render("~/css/pos.css") Generated output in debug mode is <link href="/myapp/css/mypos.css" rel="stylesheet"/> How to add media attribute to output so that style is used for screen <link href="/myapp/css/mypos.css" media="screen" rel="stylesheet"/> or for print <link href="/myapp/css/mypos.css" media="print" rel="stylesheet"/> Or is there better way to to this, can media specified in css file or other solution ? jquery and jquery

cssmin not correctly handling @import

牧云@^-^@ 提交于 2019-12-03 17:13:10
问题 I am using cssmin on files containing @imports. cssmin is recursively importing local files correctly, but for imports that point to a URL the imports are left inline. This makes the resulting minified CSS invalid because @ rules must be at the beginning of the file. Does anyone know a good solution or workaround to this problem? 回答1: I have exactly the same problem with cssmin and @import , and i found a solution with grunt concat : Create a concat grunt task that: Put @import url in the

mvc4 bundling strongly typed bundles

℡╲_俬逩灬. 提交于 2019-12-03 15:12:00
So MVC 4 introduces script and style bundling. Which allows for this: public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/mobile").Include( "~/Scripts/jquery.mobile-*")); then used in a razor view like this: @Scripts.Render("~/bundles/mobile") My question is why do I have to type "~/bundles/mobile" ? Is there a way get intellisence to have a strongly typed object to pick up on? Otherwise I have to go look it up to make sure I call it the same thing. I would like to do something like this: (I know this won't compile this way, it's just an

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

你离开我真会死。 提交于 2019-12-03 14:44:53
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 ? 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 in entry.js for example You can use webpack-concat-plugin. https://www.npmjs.com/package/webpack-concat

ASP.NET MVC bundles in Classic ASP (or PHP etc.)

不羁的心 提交于 2019-12-03 14:15:41
We have hybrid application that is still running part of the application with classic ASP along ASP.NET MVC. I would like to use bundled javascript and styles in classic ASP also. In ASP.NET we can nicely use bundled stuff with caching nicely, we are using Script.Render, which adds version hash to the fetch url. Thing is that this method of course isn't available in Classic ASP. We can use bundled directly from html <script src="bundles/js?v=<%=version%>"/> . version variable is classic ASP variable used in cache busting (force browser refresh). It is changed between versions. Problem is that

Fingerprinting externally generated static content (ASP.NET + browserify)

萝らか妹 提交于 2019-12-03 13:15:11
Nodejs browserify is terrific when building modular js apps. If gulp is part of the setup as well, the workflow is further enhanced to manage and resolve dependencies, properly bundle, uglify with sourcemaps, auto-polyfill, jshint, test... This is pretty handy for css as well with pre-processing, auto-prefixing, linting, embedding resources and generating documentation. TL;DR: with npm/bower you get access to an extensive ecosystem of front-end libraries, making nodejs perfect for building (not necessarily serving!) client-side code. In fact, using it for client-side code is so awesome that

ASP.NET MVC 4 ScriptBundle returns empty

穿精又带淫゛_ 提交于 2019-12-03 12:07:57
Specifically, I am trying to create a ScriptBundle in MVC 4 with already minified scripts, and return this same Bundle whether the project is in Debug or not. My web project references the MVC Telerik Grid NuGet package. In that package, Telerik only provides the minified JS files. Bundling code is below. // telerik scripts bundles.Add(new ScriptBundle("~/scripts/bundles/telerik").Include( "~/Scripts/2012.1.214/telerik.common.min.js", "~/Scripts/2012.1.214/telerik.textbox.min.js", "~/Scripts/2012.1.214/telerik.calendar.min.js", "~/Scripts/2012.1.214/telerik.datepicker.min.js", "~/Scripts/2012