gulp,browserify,maps? [英] 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屋!