@tarojs/rn-style-transformer 3.3.4 → 3.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ interface Location {
2
+ line: number
3
+ column: number
4
+ file: string
5
+ }
6
+
7
+ export default function reporterSkip ({ skipRows, filename }) {
8
+ // @ts-ignore
9
+ return (css, result) => {
10
+ result.messages?.forEach((message: any) => {
11
+ const { line, column, node } = message
12
+
13
+ const messageInput = node?.source?.input
14
+ if (messageInput) {
15
+ const originLocation: Location = messageInput.origin(line, column)
16
+ // 如果是原始引入的样式文件,则对拼接的代码(addionalData)函数做减法
17
+ if (originLocation && originLocation.file.includes(filename)) {
18
+ // force modify line,then source map cannot read origin column, value is 0.
19
+ message.line -= skipRows
20
+ }
21
+ }
22
+ })
23
+ }
24
+ }