Skip to content

Commit

Permalink
fix: non react app support --release
Browse files Browse the repository at this point in the history
  • Loading branch information
hemengke1997 committed Feb 26, 2025
1 parent 9d0c1c0 commit 8cf4994
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
5 changes: 5 additions & 0 deletions packages/istanbul-widget/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# istanbul-widget

## 1.10.3
### Patch Changes

- fix: non react app support

## 1.10.2
### Patch Changes

Expand Down
2 changes: 1 addition & 1 deletion packages/istanbul-widget/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "istanbul-widget",
"version": "1.10.2",
"version": "1.10.3",
"description": "收集 istanbul 代码覆盖率的web小组件",
"type": "module",
"keywords": [
Expand Down
1 change: 1 addition & 0 deletions packages/istanbul-widget/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const lib = (option: Options): Options => ({
},
},
outExtension: ({ format }) => ({ js: format === 'esm' ? '.js' : '.cjs' }),
noExternal: Object.keys(pkg.dependencies),
splitting: false,
minify: false,
injectStyle: true,
Expand Down
7 changes: 7 additions & 0 deletions packages/vite-plugin-istanbul-widget/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# vite-plugin-istanbul-widget

## 1.10.3
### Patch Changes

- fix: non react app support
- Updated dependencies
- istanbul-widget@1.10.3

## 1.10.2
### 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.10.2",
"version": "1.10.3",
"description": "集成了 istanbul-widget 和 vite-plugin-istanbul 的vite插件",
"type": "module",
"keywords": [
Expand Down
6 changes: 3 additions & 3 deletions packages/vite-plugin-istanbul-widget/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export function resolveWidgetScript(config: IstanbulWidgetOptions) {

debug('istanbul-widget path:', istanbulWidgetPath)

return /*js*/ `import { IstanbulWidget } from "${istanbulWidgetPath}";
return /*js*/ `import { IstanbulWidget } from '${istanbulWidgetPath}'
if (typeof window !== 'undefined') {
setTimeout(() => {
new IstanbulWidget(${serialize(config)});
}, 200);
new IstanbulWidget(${serialize(config)})
}, 200)
}
`
}
Expand Down

0 comments on commit 8cf4994

Please sign in to comment.