uglifyjs

Minify some files, combine all, with Grunt.JS

浪子不回头ぞ 提交于 2019-11-29 09:22:32
I'm moving a dev team away from Chirpy, an add-in for visual studio, for combination & minification of CSS/JS files, over to grunt as part of a workflow automation process. In chirpy, the config looks something like this (truncated for brevity): <FileGroup Name="scripts.combined.js" Minify="both"> <File Path="forms.js" Minify="false" /> <File Path="cookie_monster.js" Minify="true" /> ... </FileGroup> So in this abridged case, I have 2 files. One needs to be minified, the other doesn't. (according to the folks here, minifying forms.js breaks functionality, and I haven't been allocated time to

Source maps files in production - Is it safe? [closed]

半城伤御伤魂 提交于 2019-11-28 17:22:48
I'm using UglifyJS to minify and uglify my sources, and Sentry to report errors from my production environment. In order to get errors from Sentry, in a readable manner, I need to add source-map Is it safe to do it in production servers, or the source-maps files should only exist on staging environment? Is there a way to secure them on production environment? John Bernardsson Searching for a possible solution to this, and if someone is not specifically using Sentry, I got to this blog post (ironically a Sentry blog post): https://blog.sentry.io/2015/10/29/debuggable-javascript-with-source-maps

Why is it recommended to use concat then uglify when the latter can do both?

烂漫一生 提交于 2019-11-28 16:31:28
I keep seeing the recommendation for making JS files ready for production to be concat then uglify. For example here , in on of Yeoman's grunt tasks. By default the flow is: concat -> uglifyjs. Considering UglifyJS can do both concatenation and minification, why would you ever need both at the same time? Thanks. Running a basic test to see if there is a performance difference between executing concat and then uglify vs. just uglify . package.json { "name": "grunt-concat-vs-uglify", "version": "0.0.1", "description": "A basic test to see if we can ditch concat and use only uglify for JS files."

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

泪湿孤枕 提交于 2019-11-28 07:14:28
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 file and use straight HTML, since grunt build was inexplicably removing 80% of the index file when it

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

对着背影说爱祢 提交于 2019-11-28 03:15:42
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 that can help me. Thanks. I know it might seem like a huge step but I would really recommend using grunt

Minify some files, combine all, with Grunt.JS

£可爱£侵袭症+ 提交于 2019-11-28 02:50:54
问题 I'm moving a dev team away from Chirpy, an add-in for visual studio, for combination & minification of CSS/JS files, over to grunt as part of a workflow automation process. In chirpy, the config looks something like this (truncated for brevity): <FileGroup Name="scripts.combined.js" Minify="both"> <File Path="forms.js" Minify="false" /> <File Path="cookie_monster.js" Minify="true" /> ... </FileGroup> So in this abridged case, I have 2 files. One needs to be minified, the other doesn't.

“Unknown provider: aProvider <- a” How do I find the original provider?

和自甴很熟 提交于 2019-11-28 02:48:48
When I'm loading the minified (through UglifyJS) version of my AngularJS application, I get the following error in the console: Unknown provider: aProvider <- a Now, I realize that this is due to variable name mangling. The unmangled version works just fine. However, I do want to make use of variable name mangling, as it drastically reduces the size of our JS output file. For that reason, we're using ngmin in our build process, but it doesn't seem to resolve this issue, even though it served us well in the past. So, to debug this issue, I enabled source maps in our uglify grunt task. They are

Webpack bundles my files in the wrong order (CommonsChunkPlugin)

混江龙づ霸主 提交于 2019-11-27 22:50:17
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 JavaScript library dependency called Tether. Tether must be loaded before Bootstrap. webpack.config.js

Source maps files in production - Is it safe? [closed]

谁说胖子不能爱 提交于 2019-11-27 20:06:56
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . I'm using UglifyJS to minify and uglify my sources, and Sentry to report errors from my production environment. In order to get errors from Sentry, in a readable manner, I need to add source-map Is it safe to do it in production servers, or the source-maps files should only

Does it make sense to minify code used in NodeJS?

浪尽此生 提交于 2019-11-27 11:53:29
I was wondering, since Clojure Compiler and UglifyJS not only optimize code for size but also for performance (although I think size is the main priority), would my node.js app run faster if it was minified ? I know it may depend from app, but I'm asking this in general. In node, the main processing cost is I/O operations, not the actual JavaScript itself. So for example: fs.readFile(myFile, function (err, data) { processTheFile(data); }); Here, the gap between calling readFile and the callback being fired will be several times longer than the length of time the callback takes. (If it's the