-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
微信开发者工具调试中不同文件夹下的同名文件source中只有一份 #9412
Comments
|
不好意思,demo的commit忘记提交了,请使用我的Demo再试试 |
page 确实会根据目录结构进行解析 但是一些公共部分会编译到同一个类似common.js文件中,而这些打入这个文件的源文件会出现我说的扁平化 |
@Chen-jj 。 |
@moseszhou 微信小程序解析 配置 webpack.output. devtoolModuleFilenameTemplate,把路径里的 类似这样: webpackChain (chain) {
chain.output.devtoolModuleFilenameTemplate((info) => {
const resourcePath = info.resourcePath.replace(/[/\\]/g, '_')
return `webpack://${info.namespace}/${resourcePath}`
})
} |
@Chen-jj 支付宝小程序上似乎sourceMap 完全没用。不知Taro3 是否支持支付宝开发者工具中查看source。 |
同问,目前在支付宝开发者工具中,能看到从index.worker.js => vendors.js这样的映射关系,但是vendors.js文件中声明的 |
相关平台
微信小程序
小程序基础库: 2.16.1
使用框架: React
复现步骤
可用通过以下项目复现:https://github.com/moseszhou/taro3_demo
本demo为了调试weapp,在调试编译时同样的文件名,source map只会对于一个,可以看看 compnentA 和compnentB对应的source是否能同时在微信开发者工具的调试器中看到
1、在src下建两个目录(pageA 和pageB),然后在这两个目录中分别新建一个index.js (两个文件夹下文件同名)。
2、npm run dev:weapp
3、打开微信开发者工具,打开taro编译后的目录
4、可以看到在调试里面只能看到一个index.js文件
调试器会把所有的文件平铺到127.0.0.1:{port}/appservice 下,同名的文件只会有一份。
这样我就无法调试我需要调试的某些代码, 即使在代码中加入debugger,调试器会停住,但是看不到代码。
期望结果
调试的时候能够看到不同目录下的同名文件。
实际结果
同名文件只会看到一个,没有目录路径。
环境信息
The text was updated successfully, but these errors were encountered: