[转] webpack debug in webstorm

本博客指导如何在WebStorm中配置Webpack构建的客户端应用程序进行调试,通过修改tools/config.js文件设置devtool,构建应用后运行server.js启动服务器,并排除构建目录,创建JavaScript调试配置,将src文件夹中的断点映射到服务器端。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

先run build,然后用node server.js来做

WebStorm 11 adds support for debugging client-side apps built with Webpack, though you need to configure the mappings as described in this blog post.
First, in tools/config.js change  devtool: DEBUG ? 'cheap-module-eval-source-map' : false, to devtool: DEBUG ? 'source-map' : false,
Then build the app and run server.js from the command line or using Node.js run configuration.
Exclude build directory from the project.
Then create new JavaScript debug configuration for the URL http://localhost:5000
In the run configuration map build/public to http://localhost:5000 and project root to webpack:///.
Now you can put breakpoints in the original files in src folder and start JavaScript debug session.
screen shot 2015-10-23 at 16 58 54

转载于:https://www.cnblogs.com/qiangxia/p/5348143.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值