grunt-contrib-uglify

grunt-contrib-uglify v5.0.0 still unable to support ES6 Template Literals?

心不动则不痛 提交于 2021-01-29 06:07:05
问题 UPDATE, Jan 09, 2012: At first, I thought it was due to the single quotes within the template literal: replyTo: `'MTN Support' <${functions.config().supportgmail.email}>` But now, it's confirmed that even a normal template literal is not supported by grunt-contrib-uglify : throw new Error(`Unknown sender email address: ${mailOptions.from.address}.`); Same Error: Warning: Uglification failed. Unexpected token: name «sender», expected: punc «,». Line 90 in functions/app-functions.js,functions

Combine and minify all bower libraries with gruntjs

谁说我不能喝 提交于 2020-01-01 09:57:14
问题 Is there a way to combine and minify all bower installed libraries into 1 file automatically? First I tried the most basic approach: combine all .js files from all subdirectories: uglify: { options: {compress: true}, my_target: { files: { 'vendor.js': ['bower_components/**/*.js'], } } } But this is obviously a bad approach. It also doesn't work because of too many errors. I manually deleted all the files and kept only 1 (main) file that each library has, and it worked. Is there a way to do

Dynamic Mapping and Concat with Grunt Uglify

蓝咒 提交于 2019-12-31 04:29:32
问题 I'm trying to use dynamic mapping AND concat Javascript files with Grunt Uglify. I have the following which is not working correctly. Here is my folder structure: javascript |- account |- custom.js |- bills |- billing-one.js |- billing-two.js |- test (output folder) Here is what I'm expecting: javascript |- account |- custom.js |- bills |- billing-one.js |- billing-two.js |- test |- billing-one.min.js (this file includes billing-one.js AND custom.js) |- billing-two.min.js (this file includes

Is 'El Capitan's' rootless breaking old grunt configs?

不想你离开。 提交于 2019-12-22 06:58:13
问题 After migrating to El Capitan, it seems users are experiencing an issue with grunt installations, possibly related to the rootless changes of El Capitan. In particular, running the grunt --force command results in EPERM errors. The workflow is as follows: Assuming npm has been installed, navigate to the grunt directory with package.json and gruntfile.js and invoke grunt: grunt --force Example Gruntfile.js file contents: module.exports = function(grunt) { // All configuration goes here grunt

How can I skip a grunt task if a directory is empty

╄→尐↘猪︶ㄣ 提交于 2019-12-21 01:27:11
问题 I'm using grunt-contrib's concat and uglify modules to process some javascript. Currently if src/js/ is empty, they will still create an (empty) concat'd file, along with the minified version and a source map. I want to task to detect if the src/js/ folder is empty before proceeding, and if it is, then the task should skip (not fail). Any ideas how to do this? 回答1: The solution may not be the prettiest, but could give you an idea. You'll need to run something like npm install --save-dev glob

Grunt uglify not finding files

懵懂的女人 提交于 2019-12-20 02:32:30
问题 I have the following directory structure: --development -js -pages --js -pages I'm trying to take all files in development/js/pages and output them js/pages and minify them using grunt uglify but still keep seperate files - I don't want to combine all the files together. I've tried the following: build: { src: 'development/js/pages/*.js', dest: 'js/page', options: { sourceMap: true, compress: true, mangle: true } } but this gives me an error: unable to write js/page file Then I tried this,

new to grunt - warning: task “concat, uglify” not found

て烟熏妆下的殇ゞ 提交于 2019-12-12 02:27:14
问题 As the title says I'm new to Grunt. I am following a tutorial located at: http://24ways.org/2013/grunt-is-not-weird-and-hard/. It is an older tutorial but most seems to work the same. I have installed "grunt-contrib-concat" and "grunt-contrib-uglify" and can run both individually. But when I run grunt , I get the following error: Warning: Task "concat, uglify" not found. Use --force to continue. Aborted due to errors. I've been looking around and can't seem to figure it out. My files are as

How to use minified javascript?

≡放荡痞女 提交于 2019-12-10 10:46:53
问题 I have a grunt tasks to concat and minify all my javascript files into one single file and the javascript file is in dist folder. "dist/<%= pkg.name %>.min.js'" "Gruntfile.js" module.exports = function (grunt) { grunt.initConfig({ pkg: grunt.file.readJSON("package.json"), concat: { options: { separator: ';' }, dist: { src: ['src/main/resources/app/js/**/*.js', 'src/main/resources/app/config/*.js', 'src/main/resources/app/app/js'], dest: 'dist/<%= pkg.name %>.js' } }, uglify: { options: {

Grunt Uglify source map “unable to write”

我的梦境 提交于 2019-12-07 08:20:15
问题 I'm using Grunt to concat and minify files (with grunt-contrib-uglify and grunt-contrib-concat ) and I wanted to add a source map. The uglify docs say to just add an option for sourceMap set to a boolean of true. But when I add that to my tasks (I've tried a couple different ones) the process runs fine until it gets to the source map part, then I get: Writing true...ERROR Warning: Unable to write "true" file (Error code: undefined). Use --force to continue. The concatenation is done, the

Disable minification in Grunt (Yeoman)

六眼飞鱼酱① 提交于 2019-12-07 05:28:16
问题 I recently started using GruntJS through Yeoman and I like the idea of Javascript minification, but it presents difficulties during development. I tried to disable uglify,usemin, etc in different combinations in the Gruntfile but everything seems to be dependent on another thing and breaks the process. Is there a simple way to disable minification? I am using the latest versionof Grunt offered by Yeoman to date, I found that older solutions have a different Gruntfile setup than that usd with