Skip to content

Commit

Permalink
fix: sourcemap incorrect --release
Browse files Browse the repository at this point in the history
  • Loading branch information
hemengke1997 committed Feb 14, 2025
1 parent 2d04d5f commit ace95a0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
5 changes: 5 additions & 0 deletions packages/vite-plugin-istanbul-widget/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# vite-plugin-istanbul-widget

## 1.9.5
### Patch Changes

- fix: sourcemap incorrect

## 1.9.4
### Patch Changes

Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin-istanbul-widget/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite-plugin-istanbul-widget",
"version": "1.9.4",
"version": "1.9.5",
"description": "集成了 istanbul-widget 和 vite-plugin-istanbul 的vite插件",
"type": "module",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin-istanbul-widget/src/astro/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function istanbulWidget(opts: VitePluginIstanbulWidgetOptions): any {

return {
code,
map: { mappings: '' },
map: null,
}
}
}
Expand Down
12 changes: 9 additions & 3 deletions packages/vite-plugin-istanbul-widget/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ export function istanbulWidget(opts: VitePluginIstanbulWidgetOptions): any {
async load(id) {
switch (id) {
case resolvedVirtualModuleId(runtimeId): {
return resolveWidgetScript(istanbulWidgetConfig || {})
return {
code: resolveWidgetScript(istanbulWidgetConfig || {}),
map: null,
}
}
default:
break
Expand All @@ -99,9 +102,12 @@ export function istanbulWidget(opts: VitePluginIstanbulWidgetOptions): any {
}

if (isEntry) {
return `import '${runtimeId}';
return {
code: `import '${runtimeId}';
${code}
`
`,
map: null,
}
}
},
},
Expand Down

0 comments on commit ace95a0

Please sign in to comment.