Skip to content
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

webpack sourcemap #10

Open
lzzfsm opened this issue Apr 20, 2020 · 0 comments
Open

webpack sourcemap #10

lzzfsm opened this issue Apr 20, 2020 · 0 comments

Comments

@lzzfsm
Copy link

lzzfsm commented Apr 20, 2020

使用source-map模式生成对应的map文件。
然后解析内部的mapping字段
通过解码查看到
webpack:///app.js-console [3:4]=>[117:0]
webpack:///app.js-info [3:12]=>[117:12]
源代码:
console.log('123')
js打包后代码
console.log('123')
源代码的console的列信息是4,info列信息是12
打包后的console的列信息是0,info列信息是12
总结后发现每一行的第一个方法或者对象打包后列信息都是0,前面的空格没有计算进去。
无论是源代码还是js打包后代码,console前面都有4个空格。
计算console列信息的时候,源代码的空格计算进去了,打包后的代码空格没有计算进去。
但是info的列信息却计算了空格;
请问这个问题大神们能帮忙看看吗?

@lzzfsm lzzfsm closed this as completed Apr 20, 2020
@lzzfsm lzzfsm reopened this Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant