如何调试gulp-sourcemaps不做任何事情? [英] how to debug gulp-sourcemaps not doing anything?

查看:189
本文介绍了如何调试gulp-sourcemaps不做任何事情?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 gulp-sourcemaps

https://github.com/floridoo/gulp-sourcemaps

  gulp.src( bundle.src)
           .pipe(sourcemaps.init())
           .pipe(concat(bundle.dst + '.' + opts.ext))
            .pipe(uglify())
            .pipe(sourcemaps.write())
            .pipe(gulp.dest('./public/built'));

这会产生适当的连接和丑化文件。但是没有源图添加到它们。 bundle.src 是一个文件路径数组。不知道如何进行调试。

This produces appropriately concatenated and uglyified files. However there are no source map additions to them. bundle.src is an array of file paths. Not sure how to debug this.

推荐答案

您应该查看 gulp-util 。它可能会让你对实际发生的事情有所了解。

You should look into gulp-util. It may give you some insight into what is actually happening.

var gutil = require('gulp-util')
...
.pipe(sourcemaps.init().on('error', gutil.log))

这篇关于如何调试gulp-sourcemaps不做任何事情?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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