咕噜uglify任务失败 [英] grunt uglify task failing

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

问题描述

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


警告:无法写入client / dist / js / build.js 文件(错误代码:未定义)。使用--force继续。

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:

Warning: Unable to write "client/dist/js/build.js" file (Error code: undefined). Use --force to continue.

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任务失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆