吞咽,browserify,地图? [英] gulp, browserify, maps?

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

问题描述

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

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'));
  });

哎呀......出于某种原因,在 github 页面 上用于 gulp-browserify 它说:插件被列入黑名单.

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

我不明白...那我该怎么用 browserify 和我的咖啡脚本文件呢?

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

更新:

我不认为下面这很混乱".

I don't think this below is "messy".

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'));
});

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

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