minify

Angular CLI - why does <ng serve> bundle better than <ng build>?

家住魔仙堡 提交于 2019-12-07 02:11:36
问题 Performing a number of Angular CLI commands in order to build the minified basic project: ng new project cd project ng build --prod ... as a result, I get the generated dist folder with a number of bundles. The largest one is called vendor.[hash].js and it's size about 855kB . However, if I perform ng serve --prod instead: ng new project cd project ng serve --prod ... I can see the loaded by localhost:4200 vendor's bundle weight is about 300kB using Chrome console. Why is that happens? Is

Meleze.web asp.net mvc 3 razor minify and compress html

夙愿已清 提交于 2019-12-06 15:13:34
问题 I have find meleze.web in nuget to remove extra white spaces in generated html result. but when i set web.config new , and run nothing happend to result. is there any correct sample or special configs ? <configuration> <system.web.webPages.razor> <host factoryType="Meleze.Web.Razor.MinifyHtmlWebRazorHostFactory,Meleze.Web.Razor" /> </system.web.webPages.razor> </configuration> 回答1: For a little bit of context, we're talking about the tool described here: http://cestdumeleze.net/blog/2011

Usage of YUI Compressor Maven Mojo minifying javascript

孤者浪人 提交于 2019-12-06 13:40:24
I work on a struts2 project using maven to compile. I am trying to minify the javascript files, which are located in different locations. <plugin> <groupId>net.alchim31.maven</groupId> <artifactId>yuicompressor-maven-plugin</artifactId> <version>1.3.0</version> <executions> <execution> <goals> <goal>compress</goal> </goals> </execution> </executions> <configuration> <nosuffix>true</nosuffix> </configuration> </plugin> I assume that by doing this, all js files will be minified and replaced the original file in the production war file (according to definition for nosuffix). However it doesn't

Combine and minify templates with CoffeeScript / Cake

与世无争的帅哥 提交于 2019-12-06 13:36:04
问题 I have a src/templates/ directory full of mustache templates. How would I combine and minify the contents of those, so they're available for use in my CoffeeScript app? I'm already following the directions at https://github.com/jashkenas/coffee-script/wiki/%5BHowTo%5D-Compiling-and-Setting-Up-Build-Tools for combining and minifying my CoffeeScript src into js. 回答1: First off, I'll assume that your templates are being exported to the global object (e.g. each one does window.userpane = rather

使用gulp构建项目

送分小仙女□ 提交于 2019-12-06 12:16:33
一.环境准备 1.1 gulp介绍 gulp是基于node.js 文件流的一个前端自动化构建工具,可以使用它构建自动化工作流程,简化工作量 官方定义: 基于文件流的构建系统 核心文件: gulpfile.js 和 package.json gulpfile.js:任务脚本 package.json:任务配置文件 1.2 安装gulp npm install gulp -g 1.3 构建项目 (1)切换到项目根目录(即 gulpfile.js 所在目录),命令行安装任务所依赖的包: npm install (2)安装完成后,即可直接执行命令: gulp 二.使用实例 - 打包js和css 2.1 在 package.json 中引用依赖 gulp-minify-css 和 gulp-uglify "devDependencies": { "del": "^2.2.2", "gulp": "^3.9.1", "gulp-header": "^1.8.8", "gulp-minify-css": "^1.2.4", "gulp-replace": "^0.6.1", "gulp-uglify": "^1.5.4" } 2.2 定义我们第一个gulp流程 var pkg = require('./package.json'); var del = require('del'); var

Minify client through Play Framework

折月煮酒 提交于 2019-12-06 11:53:09
问题 How can I minify JS & CSS through play-framework? 'Google Closure Compiler' is no longer an option since it was removed. I am using play Activator 2.3.7 Note: This question is not duplicate since Google Closure Compiler was removed from activator 2.3.7. 回答1: Play 2.4 is the same. Add empty main.js to public folder plugins.sbt: addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.7") build.sbt: pipelineStages := Seq(rjs) Generate production executable: $activator stage Run results: ./target

Play framework auto javascript and CSS minifier

社会主义新天地 提交于 2019-12-06 11:41:49
Does anyone know a good play plugin that automatically minifies javascript and css to attach to a production play server? I've found this one, but I guess there are more out there: https://github.com/greenlaw110/play-greenscript The main problem I see here is that the having javascript being generated from the play side, the plugin would have to detect JS code that gets generated on the fly. Mainly because I'm writing values directly into the javascript like: function foo${handlerID}(someVar){ var x = ${some_val}; (...) } var t = foo${handlerID}('bar'); The reason we do minimizing/compressing

gulp-uglify won't preserve files order

梦想的初衷 提交于 2019-12-06 09:56:55
When I use gulp-uglify to minify the Javascript files the order gets messed up. Lets say I have this task working as expected: var gulp = require('gulp'); var rename = require('gulp-rename'); var gp_concat = require('gulp-concat'); gulp.task('js', function() { gulp.src([ './public/bower_components/jquery/dist/jquery.min.js', './public/js/functions.js', ]) .pipe(gp_concat('combined.js')) .pipe(gulp.dest(path.js + '/dist')) }); Adding the uglify line to it changes the order of the jquery and functions files and places functions.js above jquery . var gulp = require('gulp'); var rename = require(

Do you have any tips for C# Minification? [closed]

╄→гoц情女王★ 提交于 2019-12-06 07:36:37
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 months ago . I need to minify some C# code in a handful of Silverlight .cs and .xmal files. What are your tips for maintaining one code base and running a "tool" to generate minified code for a project? Are there any tools (like Resharper) that will do this? If not fully, partially or assist in some way... EDIT: I realize

Is there a way to minify an ExtJS application without Sencha CMD?

久未见 提交于 2019-12-06 07:36:23
问题 I have an existing ExtJS app developed using ExtJS 4.2.1. I am using Closure minifier through Maven plugin minify-maven-plugin. The generated minified JS files (without merge) works fine. However, generated merged minified file throws undefined errors because the definition comes later in the merged file. My question is, is there a way I can figure out the order I have to provide the plugin? (I don't want to use Sencha Cmd) The app folder follows the structure app/common, app/controller, app