grunt-contrib-uglify抛出RangeError

时间:2015-02-06 22:01:30

标签: javascript gruntjs grunt-contrib-uglify

我的文件夹结构类似于以下内容

build/
  dist/
    app/
      js/
        third-party/
          jquery.min.js
        js-file1.js
        js-file2.js
    view/
      js/
        js-file.js
        js-file4.js

我想要做的是使用uglify单独缩​​小所有JS文件(忽略第三方javascript文件),而不使用grunt-contrib-uglify将其全部捆绑到单个文件中并覆盖相应的文件。基本上,如果原始文件是build/dist/app/js/js-file1.js,在我运行grunt任务后,它仍然在build/dist/app/js/js-file1.js但是缩小了。

任务如下所示:

uglify: {
  options: {
    mangle: false,
    preserveComments: false
  },
  files: [{
    expand: true,     // Enable dynamic expansion.
    cwd: 'build/dist/',      // Src matches are relative to this path.
    src: ['**/*.js', '!**/thirdparty/*'], // Actual pattern(s) to match.
    dest: 'build/dist/',   // Destination path prefix.
    ext: '.js',   // Dest filepaths will have this extension.
    extDot: 'first'   // Extensions in filenames begin after the first dot
  }]
}

当我运行任务时,我收到以下错误,我不确定我做错了什么。

(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.

util.js:35
  var str = String(f).replace(formatRegExp, function(x) {
                      ^
RangeError: Maximum call stack size exceeded

思想?

0 个答案:

没有答案