File tree 1 file changed +10
-20
lines changed
packages/plugin-vue/src/utils
1 file changed +10
-20
lines changed Original file line number Diff line number Diff line change @@ -5,26 +5,16 @@ export function createRollupError(
5
5
id : string ,
6
6
error : CompilerError | SyntaxError
7
7
) : RollupError {
8
- if ( 'code' in error ) {
9
- return {
10
- id,
11
- plugin : 'vue' ,
12
- message : error . message ,
13
- parserError : error ,
14
- loc : error . loc
15
- ? {
16
- file : id ,
17
- line : error . loc . start . line ,
18
- column : error . loc . start . column
19
- }
20
- : undefined
21
- }
22
- } else {
23
- return {
24
- id,
25
- plugin : 'vue' ,
26
- message : error . message ,
27
- parserError : error
8
+ ; ( error as RollupError ) . id = id
9
+ ; ( error as RollupError ) . plugin = 'vue'
10
+
11
+ if ( 'code' in error && error . loc ) {
12
+ ; ( error as any ) . loc = {
13
+ file : id ,
14
+ line : error . loc . start . line ,
15
+ column : error . loc . start . column
28
16
}
29
17
}
18
+
19
+ return error as RollupError
30
20
}
You can’t perform that action at this time.
0 commit comments