We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f1b8b5f commit 5c07cecCopy full SHA for 5c07cec
packages/plugin-vue/src/utils/error.ts
@@ -5,16 +5,22 @@ export function createRollupError(
5
id: string,
6
error: CompilerError | SyntaxError
7
): RollupError {
8
- ;(error as RollupError).id = id
9
- ;(error as RollupError).plugin = 'vue'
+ const { message, name, stack } = error
+ const rollupError: RollupError = {
10
+ id,
11
+ plugin: 'vue',
12
+ message,
13
+ name,
14
+ stack
15
+ }
16
17
if ('code' in error && error.loc) {
- ;(error as any).loc = {
18
+ rollupError.loc = {
19
file: id,
20
line: error.loc.start.line,
21
column: error.loc.start.column
22
}
23
24
- return error as RollupError
25
+ return rollupError
26
0 commit comments