Skip to content

Commit

Permalink
feat: cleanLocal also removes CSS sourcemap files
Browse files Browse the repository at this point in the history
  • Loading branch information
kricsleo committed Mar 28, 2023
1 parent 8fb7a88 commit 3183bf3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 73 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"test": "vitest"
},
"dependencies": {
"@sentry/cli": "^2.7.0",
"@sentry/cli": "^2.16.1",
"rimraf": "^3.0.2",
"unplugin": "^0.10.2"
},
Expand Down
76 changes: 6 additions & 70 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ export async function publishProject(options: Options) {
throw new Error(`[UnpluginSentry]: When using "cleanLocal", the "include" must be an array of string.`)
}
const sourmapGlobs = (sourcemap.include as string[]).map(
dir => path.resolve(process.cwd(), dir, './**/*.js.map'),
)
dir => [
path.resolve(process.cwd(), dir, './**/*.js.map'),
path.resolve(process.cwd(), dir, './**/*.css.map'),
],
).flat()
!silent && console.log(`[UnpluginSentry]: Cleaning local sourcemap ${sourmapGlobs}`)
await Promise.all(sourmapGlobs.map(glob => deleteFile(glob)))
}
Expand Down

0 comments on commit 3183bf3

Please sign in to comment.