uglifyjs

Conditional compilation in CoffeeScript/UglifyJS

淺唱寂寞╮ 提交于 2019-12-03 09:27:13
问题 Using Coffeescript I need to have a go through a build script anyway to update my .js files, and I have two of them, one for debugging and one for production (one uses Uglify to minimize the files, one does not). So I was thinking that it would be convenient to have some conditional compilation as well, with code that only enters the debug build. What is the easiest way to achieve this, ideally controlled by a simple command line switch that I can give to either coffee or uglify? 回答1: If you

How to exclude certain requireJS files from uglifying/optimizing

六月ゝ 毕业季﹏ 提交于 2019-12-03 06:42:08
问题 I have a working requirejs project that is using grunt for building and deployment. If using no optimization at all, the build is working without problems and I get one big js file to deploy it on production. The problem I have is, that I have some external frameworks (like angularJS) where I already have a minimized/optimized version of it and don't want to optimize it again. Currently without optimization I include the minified version of this framework via a seperate path config in my

How to define individual flows in useminPrepare for each block in html file?

血红的双手。 提交于 2019-12-03 06:22:05
We have 2 blocks defined in our index.html - one for 3rd party libs and one for our application files. Since 3rd party libs are already minified, we just want to concatenate them, but not uglify. How can I do this with useminPrepare ? <!-- build:js js/lib.js --> <script src="lib/angular/angular.min.js"></script> <script src="lib/angular-cookies/angular-cookies.min.js"></script> <script src="lib/angular-route/angular-route.min.js"></script> <!-- endbuild --> <!-- build:js js/app.js --> <script src="js/app.js"></script> <script src="js/controllers/LanguageCtrl.js"></script> <!-- endbuild -->

webpack 4 disable uglifyjs-webpack-plugin

这一生的挚爱 提交于 2019-12-03 06:07:44
I have had this problem for the last 2 days. So I decided to completely disable uglifyjs-webpack-plugin from webpack build process. I was not able to find anything on webpack 4. module.exports = { optimization:{ minimize: false, // <---- disables uglify. // minimizer: [new UglifyJsPlugin()] if you want to customize it. } } 来源: https://stackoverflow.com/questions/51263506/webpack-4-disable-uglifyjs-webpack-plugin

Disable uglyfying in r.js

∥☆過路亽.° 提交于 2019-12-03 05:54:47
I am looking for a way to prevent r.js (RequireJS' optimization script) from ugylyfying our JS-modules to maintain readability for debugging purposes. I expect the script (running on Node.js by the way) to have some command line option to be passed. Unfortunately, the documentation if this tool is rather poor. Pass optimize=none on the command line to r.js, or include optimize: "none" in your build script. eg: ({ baseUrl: ".", paths: { jquery: "some/other/jquery" }, name: "main", out: "main-built.js", optimize: "none" }) See http://requirejs.org/docs/optimization.html for more information. If

how to minify js files in order via grunt-contrib-uglify?

依然范特西╮ 提交于 2019-12-03 05:30:18
问题 I have a directory like below: /folder/b.js /folder/jQuery.js /folder/a.js /folder/sub/c.js I want to minify all these js files in one js file in order : jQuery.js -> a.js -> b.js -> c.js Q: 1.How can I do it via grunt-contrib-uglify?(In fact, there are lots of files, it is impractical to specify all source filepaths individually) 2.btw, How can I get unminified files when debug and get minified single file when release and no need to change script tag in html(and how to write the script tag)

Using UglifyJs on the whole Node project?

丶灬走出姿态 提交于 2019-12-03 05:16:01
I need to obfuscate my source code as best as possible so I decided to use uglifyjs2.. Now I have the project structure that has nested directories, how can I run it through uglifyjs2 to do the whole project instead of giving it all the input files? I wouldn't mind if it minified the whole project into a single file or something josh3736 I've done something very similar to this in a project I worked on. You have two options: Leave the files in their directory structure. This is by far the easier option, but provides a much lower level of obfuscation since someone interested enough in your code

How to enable minified JavaScript files in Play 2.3.1 templates?

不问归期 提交于 2019-12-03 05:09:31
问题 I was able to load the sbt-uglify 1.0.3 plugin in my Play Framework 2.3.1 app. Loading of the non-minified javascripts is pretty straightforward, but loading the minified versions seems to be impossible. In my template I use <script> tags similar to this: <script src="@routes.Assets.at("javascripts/app.js")"></script> In dev mode, the non-minified javascript version is loaded, which is fine. In prod mode (using activator start ) I see sbt-uglify generating the minified versions to the target

Minify multiple files with UglifyJS

半城伤御伤魂 提交于 2019-12-03 01:39:40
问题 Is it possible to compress multiple files with UglifyJS? Something like... uglifyjs -o app.build.js appfile1.js appfile2.js ... Also, I am running Uglify via NodeJS in Windows Command Prompt 回答1: Actually what you want to do (trick it into thinking its just 1 file) is just cat it Linux cat file1.js file2.js file3.js file4.js | uglifyjs -o files.min.js Windows (untested) type file1.js file2.js > uglifyjs -o files.min.js OR type file1.js file2.js > merged.files.js uglifyjs -o merged.files.js

Conditional compilation in CoffeeScript/UglifyJS

人走茶凉 提交于 2019-12-02 23:40:41
Using Coffeescript I need to have a go through a build script anyway to update my .js files, and I have two of them, one for debugging and one for production (one uses Uglify to minimize the files, one does not). So I was thinking that it would be convenient to have some conditional compilation as well, with code that only enters the debug build. What is the easiest way to achieve this, ideally controlled by a simple command line switch that I can give to either coffee or uglify? If you're writing a build script anyway, you can add a preprocessor step to it. Since CoffeeScript uses # to denote