Skip to content

Commit 1d8718f

Browse files
committed
chore: remove last uses of rollup replace
1 parent 84188a2 commit 1d8718f

File tree

5 files changed

+25
-19
lines changed

5 files changed

+25
-19
lines changed

dev-packages/rollup-utils/plugins/bundlePlugins.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function makeBannerOptions(title, version) {
3030
* Create a plugin to set the value of the `__SENTRY_DEBUG__` magic string.
3131
*
3232
* @param includeDebugging Whether or not the resulting build should include log statements
33-
* @returns An instance of the `@rollup/plugin-replace` plugin to do the replacement of the magic string with `true` or
33+
* @returns An instance of the `rolldown.replacePlugin` plugin to do the replacement of the magic string with `true` or
3434
* 'false`
3535
*/
3636
export function makeIsDebugBuildPlugin(includeDebugging) {

dev-packages/rollup-utils/plugins/npmPlugins.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function makeDebuggerPlugin(hookName) {
6464
* a) evaluates to `true`
6565
* b) can easily be modified by our users' bundlers to evaluate to false, facilitating the treeshaking of logger code.
6666
*
67-
* @returns A `@rollup/plugin-replace` instance.
67+
* @returns A `rolldown.replacePlugin` instance.
6868
*/
6969
export function makeDebugBuildStatementReplacePlugin() {
7070
return replacePlugin(

packages/core/rollup.npm.config.mjs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import { readFileSync } from 'fs';
44
import { dirname, join } from 'path';
5+
import { replacePlugin } from 'rolldown/plugins';
56
import { fileURLToPath } from 'url';
6-
import replace from '@rollup/plugin-replace';
77
import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils';
88

99
const packageJson = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), 'package.json'), 'utf-8'));
@@ -22,12 +22,14 @@ export default makeNPMConfigVariants(
2222
exports: 'named',
2323
},
2424
plugins: [
25-
replace({
26-
preventAssignment: true,
27-
values: {
25+
replacePlugin(
26+
{
2827
__SENTRY_SDK_VERSION__: JSON.stringify(packageVersion),
2928
},
30-
}),
29+
{
30+
preventAssignment: true,
31+
},
32+
),
3133
],
3234
},
3335
}),

packages/node-core/rollup.npm.config.mjs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import replace from '@rollup/plugin-replace';
21
import { makeBaseNPMConfig, makeNPMConfigVariants, makeOtelLoaders } from '@sentry-internal/rollup-utils';
2+
import { replacePlugin } from 'rolldown/plugins';
33
import { createWorkerCodeBuilder } from './rollup.anr-worker.config.mjs';
44

55
const [anrWorkerConfig, getAnrBase64Code] = createWorkerCodeBuilder(
@@ -26,15 +26,17 @@ export default [
2626
exports: 'named',
2727
},
2828
plugins: [
29-
replace({
30-
delimiters: ['###', '###'],
31-
// removes some rollup warnings
32-
preventAssignment: true,
33-
values: {
29+
replacePlugin(
30+
{
3431
AnrWorkerScript: () => getAnrBase64Code(),
3532
LocalVariablesWorkerScript: () => getLocalVariablesBase64Code(),
3633
},
37-
}),
34+
{
35+
delimiters: ['###', '###'],
36+
// removes some rollup warnings
37+
preventAssignment: true,
38+
},
39+
),
3840
],
3941
},
4042
}),

packages/vercel-edge/rollup.npm.config.mjs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import replace from '@rollup/plugin-replace';
21
import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils';
2+
import { replacePlugin } from 'rolldown/plugins';
33

44
export default makeNPMConfigVariants(
55
makeBaseNPMConfig({
@@ -8,12 +8,14 @@ export default makeNPMConfigVariants(
88
packageSpecificConfig: {
99
context: 'globalThis',
1010
plugins: [
11-
replace({
12-
preventAssignment: true,
13-
values: {
11+
replacePlugin(
12+
{
1413
'process.argv0': JSON.stringify(''), // needed because otel relies on process.argv0 for the default service name, but that api is not available in the edge runtime.
1514
},
16-
}),
15+
{
16+
preventAssignment: true,
17+
},
18+
),
1719
{
1820
// This plugin is needed because otel imports `performance` from `perf_hooks` and also uses it via the `performance` global.
1921
// It also imports `inspect` and `promisify` from node's `util` which are not available in the edge runtime so we need to define a polyfill.

0 commit comments

Comments
 (0)