uglifyjs

How to minify multiple Javascript files in a folder with UglifyJS?

喜你入骨 提交于 2019-12-17 21:41:23
问题 Hello I'm using uglifyJs to minify my javascript files, it's working well with one file at a time, what I'm loking for is to minify all the javascript files present in a folder called JS into a folder called JSM, to be clear I have 2 files inside my JS folder called test1.js and test2.js and I want to run uglify against that folder and generate test1.min.js and test2.min.js inside the JSM folder, so is there a way to do this? a command like : uglifyjs -c -m JS/*.js JSM/*.min.js Or any idea

Angular “Unknown Provider” error after minification with Grunt Build in Yeoman app

不问归期 提交于 2019-12-17 18:27:48
问题 I'm having problems with grunt build on a Yeoman generated Angular app, using Coffee and Slim, with all libraries up-to-date. (The app was just generated a few days ago with the most recent generator.) grunt build and grunt server both worked fine initially. But after a few days of development using grunt server , I discovered that grunt build had stopped working entirely. There were a few different problems that I fixed. The biggest one was that I had to abandon Slim entirely for my index

Webpack bundles my files in the wrong order (CommonsChunkPlugin)

蓝咒 提交于 2019-12-17 09:42:30
问题 What I want is to bundle my JavaScript vendor files in a specific order via CommonsChunkPlugin from Webpack. I'm using the CommonsChunkPlugin for Webpack. The usage from the official documentation is straight forward and easy. It works as intended but I believe the plugin is bundling my files in alphabetical order (could be wrong). There are no options for the plugin to specify the order they should be bundled. Note: For those who are not familiar with Bootstrap 4, it currently requires a

remove console.logs with Webpack & Uglify

非 Y 不嫁゛ 提交于 2019-12-17 06:29:29
问题 I am trying to remove console.logs with Webpack's Uglify plugin but it seems that Uglify plugin that comes bundled with Webpack doesn't have that option, its not mentioned in documentation. I am initializing uglify from webpack like this: new webpack.optimize.UglifyJsPlugin() My understanding is that I can use standalone Uglify lib to get all the options, but I don't know which one? The problem is that drop_console isn't working. 回答1: With UglifyJsPlugin we can handle comments, warnings,

Should Rails uglifier uglify (mangle) function names?

不羁的心 提交于 2019-12-14 03:47:38
问题 My .js files are compressed and variables mangled, but function names are not mangled (running latest Rails 3.2.8 and latest uglify 1.3.0 gem) on Heroku. According to https://github.com/lautis/uglifier#usage the "mangle" option defaults to true. Below is my config. From production.rb: config.assets.compress = true config.assets.js_compressor = :uglifier I've also tried config.assets.compress = true config.assets.js_compressor = Uglifier.new(:mangle => true, :toplevel => true, :copyright =>

Uglify/minify Polymer web components using gulp

喜夏-厌秋 提交于 2019-12-14 02:37:54
问题 I am trying to minify my web components using gulp's uglify plugin but it fails because it does not recognize the custom html tags. Are there any gulp plugins that can minify html containing custom tags? 回答1: To do this is quite the challenge. You use the crisper plugin to factor out the script into it's own file. You can then minify the script source. Afterwards use vulcanize to inline your script back into the HTML. 回答2: Try out gulp-htmlmin. I use it to minify my elements.html file after

angular js $injector:modulerr Failed to instantiate module with mangle

人盡茶涼 提交于 2019-12-13 16:26:25
问题 Trying to uglify angularjs app with mangle causes the error. However I've read that that should be fixed by ngmin. I use ngmin to properly wrap my controller code in an array as required by angular. I can confirm that ngmin works and all my code is wrapped. Only mangling causes the error, mangle:false works just fine. Can anyone confirm whether mangling is supposed to work or if there are edge cases other than the array issue that causes mangling to fail. Thanks. 回答1: I could not get it to

Laravel 5.4 Mix How to Mangle / Uglify / Obfuscate Scripts

北慕城南 提交于 2019-12-13 07:05:59
问题 Laravel 5.4 - Mix How to Mangle / Uglify / Obfuscate Scripts I use gulp on previous version. Thank you 回答1: From the Laravel Mix documentation: mix.options({ extractVueStyles: false, processCssUrls: true, purifyCss: false, uglify: {}, postCss: [] }); You can use the uglify option to merge any custom uglify options that your project requires 来源: https://stackoverflow.com/questions/42870454/laravel-5-4-mix-how-to-mangle-uglify-obfuscate-scripts

Disable uglyfying in r.js

♀尐吖头ヾ 提交于 2019-12-12 07:32:55
问题 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. 回答1: 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:

uglifyjs on client-side javascript ? (or an alternative parser)

元气小坏坏 提交于 2019-12-12 04:35:34
问题 I need to parse (and possibly modify) a js expression from within javascript (Specifically i want to markup some eval() expressions before the actual eval) I really like the UglifyJS README examples, but alas, it needs node.js Is there any way to get this to run on clientside browser?! (i am not really a js expert so if i am completely misunderstanding this platform thingy please let me know) Failing that, is there an alternative js parser ? Currently i am looking LintJS or esprima or