Sourcemap support?
Should this plugin work with gulp-sourcemaps?
I'm asking because in my case it doesn't seem to --- the addition of this plugin into my stream makes the sourcemaps inaccurate.
I see no mention of "sourcemap" in the repo; so before I dug deeper I just wanted to check: Has any effort already been made to support sourcemaps with this plugin? Maybe I am missing something?
Hmm, can you paste your gulp task so we can take a look?
It's a little bit odd because it starts with a Browserify bundle:
function bundleApp(b, cb) {
cb = cb || _.noop;
return b.bundle()
.on('error', function(err) { console.error(err); })
.pipe(vinylSourceStream('htcInit.js'))
.pipe(vinylBuffer())
.pipe(gSourcemaps.init({ loadMaps: true }))
.pipe(gIf(cliOptions.nodevlog || cliOptions.dist, gReplace(devlogRegExp, '')))
.pipe(gSourcemaps.write())
.pipe(gulp.dest(jsDestDir))
.on('end', cb);
}
gulp.task('js:dev', function(cb) {
var appBundler = browserify(jsEntry, options.browserify)
.external(vendorLibs)
.transform(to5ify);
bundleApp(appBundler, cb);
});
Seems that if I leave out the line that calls gReplace(), although the end result has accurate sourcemaps; but when I add it in, sourcemaps break. Maybe it's a mistake in how I'm piping things together, dealing with Browserify streams vs. vinyl streams, etc.
Yeah, I could see how this would break things -- the source map won't match after we replace. I wonder how much work it would take to add support...
Ok, so that's not a situation that's already been taken into account. If I have the chance I'll try to look into it. And of course if you @lazd or someone else can add that support, that would be grand. Thanks.
I was hoping there would be some built-in Gulp way to make sourcemaps like magic, but I don't think there is, right? gulp-sourcemaps basically says that each plugin is responsible for creating its own sourcemaps. I have no idea how to do that, so can't promise any timely help here.
any updates? :/
@lazd found anyone yet who could add support for this? I've been looking into it myself but at the moment I haven't got time to really put the necessary effort in...
@call-a3 unfortunately no, and I don't have time myself :-/
regexp-sourcemaps may be helpful to generate sourcemaps
I've also run into this when refactoring the Semantic UI build pipeline to use sourcemaps.
Guidance on how to add sourcemap support for gulp plugins can be found here
Any update on this? This is the last gulp plugin we are relying on that needs sourcemap support. Other plugins that have it are listed here.
No update, but PRs gladly accepted.
On Mon, Jun 5, 2017 at 2:10 PM, Seth Westphal [email protected] wrote:
Any update on this? This is the last gulp plugin we are relying on that needs sourcemap support. Other plugins that have it are listed here https://github.com/gulp-sourcemaps/gulp-sourcemaps/wiki/Plugins-with-gulp-sourcemaps-support .
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lazd/gulp-replace/issues/37#issuecomment-306311265, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMSgMTQehdTNC9sxjjTYYJHemcd8xMxks5sBG7BgaJpZM4DUQtU .