Browserify和Reactify源映射包括完整的本地路径名 [英] Browserify and Reactify source maps include full local path names

查看:118
本文介绍了Browserify和Reactify源映射包括完整的本地路径名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用watchify/browserify通过此命令创建带有调试源映射的包-

I use watchify/ browserify to create a bundle with debug source maps with this command-

watchify main.js -o bundle.js -v -d 

当我使用Chrome DevTools调试生成的应用程序时,可以在DevTools的 Sources 面板中看到的原始嵌套文件夹位置中访问源文件.

When I use Chrome DevTools to debug the resulting app, the source files are accessible in their orginal nested folder locations, visible in DevTools' Sources panel.

但是,当我使用此命令通过reactify运行它时-

However when I run it through reactify with this command-

watchify main.js -t reactify -o bundle.js -v -d

Chrome DevTools将所有源文件显示在与bundle.js相同的文件夹中,并且文件名包含完整的本地路径名.

Chrome DevTools shows all the source files in the same folder as bundle.js and the file name includes the full local path name.

由于文件太长而无法显示,我发现这很烦人并且很难在源"面板和各个选项卡中识别出正确的文件.

I am finding this annoying and hard to identify the correct file both in the sources panel and in the individual tabs as the file is too long to display.

是否有人知道如何解决此问题,以便源文件显示在其原始文件夹位置(如图1所示).谢谢

Does anyone know how to get around this so that the source files display in their original folder locations (as per pic 1). Thx

推荐答案

您需要将-full-paths 选项指定为browserify的 false

You need specify the --full-paths option for browserify as false

请参阅: https://github.com/substack/node-browserify#usage

watchify main.js -t reactify -o bundle.js -v -d --full-paths=false

这篇关于Browserify和Reactify源映射包括完整的本地路径名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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