本文介绍了咕噜uglify任务失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行grunt时,出现以下错误:

uglify在我的 Gruntfile.js中的配置

  uglify:{
build:{
src:['client / src / js /*.js'],
dest:['client / dist / js / build.js']
}
}

我使用 grunt-contrib-uglify




解决方案

假设你的Grunt版本是0.4.0,AFAIK你没有使用最新的语法(请参阅 https://github.com/gruntjs/grunt-contrib-尝试

  uglify:{
build:{
files:{$ b $'client / dist / js / build.js':['client / src / js / *。js']
}
}
}

我也不确定wildc ards处理得当。

When running grunt, I get the following error:

The config of uglify in my Gruntfile.js :

uglify: {
      build: {
        src: ['client/src/js/*.js'],
        dest:['client/dist/js/build.js']
      }
    }

I'm using grunt-contrib-uglify.

Any ideas why this is happening?

Assuming your Grunt Version is 0.4.0, AFAIK you are not using the most recent Syntax (See https://github.com/gruntjs/grunt-contrib-uglify#usage-examples).

Try

uglify: {
    build: {
        files: {
            'client/dist/js/build.js': ['client/src/js/*.js']
        }
    }
}

I am also not sure if the wildcards are handled properly.

这篇关于咕噜uglify任务失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-17 18:19