gulp,browserify,maps? [英] gulp, browserify, maps?

查看:97
本文介绍了gulp,browserify,maps?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何启用源地图?我这样做:

How do I enable source maps? I'm doing this:

  var browserify = require("gulp-browserify")

  gulp.task("compile:client", function() {
    gulp.src("src/client/app.coffee", {
      read: false
    })
    .pipe(browserify({
      debug: true // THIS DOES NOTHING :(
      transform: ['coffeeify'],
      extensions: ['.coffee']
    }))
    .pipe(rename('app.js'));
  });

哎...因为某些原因,在gulp-browserify的 github网页上显示:
PLUGIN IS BLACKLISTED。

Ouch... for some reason on the github page for gulp-browserify it says: PLUGIN IS BLACKLISTED.

我不知道如何使用browserify和coffeescript文件?

I don't get it... how the heck I'm suppose to use browserify with my coffeescript files then?

UPD:哈!我错了: debug 选项的工作原理只是把源地图信息放到输出的javascript文件。

UPD: Ha! I was wrong: debug option works. It just sticks source maps info right there into the output javascript file. Awesome. Still the question remains open: why this plugin in blacklisted?

推荐答案

看看这里:

https://github.com/gulpjs/plugins/issues/47

,其中:

https://github.com/gulpjs/gulp/issues/369

UPDATE:

我不认为这是凌乱。

var source = require('vinyl-source-stream');
var browserify = require('browserify');

var bundler = browserify('./js/index.js');

gulp.task('compile', function(){
  return bundler.bundle({standalone: 'noscope'})
    .pipe(source('noscope.js'))
    .pipe(gulp.dest('./dist'));
});

这篇关于gulp,browserify,maps?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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