Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion packages/bundler-plugin-core/build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,25 @@ export default defineBuildConfig({
},
},
hooks: {
"rollup:options": (_ctx, opts) => {
"rollup:options": (ctx, opts) => {
// We want to ensure that `@sentry/core` is not externalized
// So we do not ship this dependency to users, as this may lead to conflicts with their installed Sentry versions
// TODO: When unbuild is updated to 3.3.0, this can be simplified by configuring `inlineDependencies`
// See: https://github.com/unjs/unbuild/releases/tag/v3.3.0
// Inspired by https://github.com/nuxt/nuxt/blob/f0ce20388d2ab533eba016de0565c150ea3c5172/packages/schema/build.config.ts#L23-L34
ctx.options.rollup.dts.respectExternal = false;
const isExternal = opts.external as (
id: string,
importer?: string,
isResolved?: boolean,
) => boolean;
opts.external = (source, importer, isResolved) => {
if (source === "@sentry/core") {
return false;
}
return isExternal(source, importer, isResolved);
};

if (process.env.PLUGIN_CODECOV_TOKEN && Array.isArray(opts.plugins)) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-floating-promises
opts.plugins = [
Expand Down
2 changes: 1 addition & 1 deletion packages/bundler-plugin-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"@sentry/core": "^8.42.0",
"chalk": "4.1.2",
"semver": "^7.5.4",
"unplugin": "^1.10.1",
"zod": "^3.22.4"
},
"devDependencies": {
"@octokit/webhooks-definitions": "^3.67.3",
"@sentry/core": "^8.42.0",
"@types/node": "^20.11.15",
"@types/semver": "^7.5.6",
"@vitest/coverage-v8": "^2.1.8",
Expand Down
Loading