From 8e47b45ab8529a2179a0dcb06dc9ab9cc7b6b1c4 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 21:15:14 +0000 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Drop=20@rollup/plugin-repl?= =?UTF-8?q?ace=20for=20rolldown=20builtin=20(#6675)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace `@rollup/plugin-replace` with Rolldown's built-in `replacePlugin` from `rolldown/plugins`. - **`rolldown.common.config.js`**: Switch to `replacePlugin(values, { preventAssignment: true })` — the builtin separates values from options - **`packages/fast-check/rolldown.config.js`**: Return only replacement values from callback; `preventAssignment` moves to common config - **`package.json`**: Remove `@rollup/plugin-replace` devDependency > [!WARNING] > >
> Firewall rules blocked me from connecting to one or more addresses (expand for details) > > #### I tried to connect to the following addresses, but was blocked by firewall rules: > > - `rolldown.rs` > - Triggering command: `/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js` (dns block) > > If you need me to access, download, or install something from one of these locations, you can either: > > - Configure [Actions setup steps](https://gh.io/copilot/actions-setup-steps) to set up my environment, which run before the firewall is enabled > - Add the appropriate URLs or hosts to the custom allowlist in this repository's [Copilot coding agent settings](https://github.com/dubzzz/fast-check/settings/copilot/coding_agent) (admins only) > >
Original prompt > drop rollup plugin replace in favor of https://rolldown.rs/builtin-plugins/replace
--- ✨ Let Copilot coding agent [set things up for you](https://github.com/dubzzz/fast-check/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: dubzzz <5300235+dubzzz@users.noreply.github.com> --- package.json | 1 - packages/fast-check/rolldown.config.js | 1 - pnpm-lock.yaml | 19 ------------------- rolldown.common.config.js | 8 +++++--- 4 files changed, 5 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index ffa78c39..66b18a88 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "@changesets/cli": "^2.30.0", "@eslint/js": "^10.0.1", "@fast-check/packaged": "*", - "@rollup/plugin-replace": "^6.0.3", "@typescript-eslint/utils": "^8.56.1", "@vitest/coverage-v8": "^4.0.18", "all-contributors-cli": "^6.26.1", diff --git a/packages/fast-check/rolldown.config.js b/packages/fast-check/rolldown.config.js index 7364ec2a..25b54126 100644 --- a/packages/fast-check/rolldown.config.js +++ b/packages/fast-check/rolldown.config.js @@ -19,7 +19,6 @@ function getCommitHash() { } export default buildConfigFor(pkg, import.meta.dirname, (isESM) => ({ - preventAssignment: true, 'process.env.__PACKAGE_TYPE__': isESM ? JSON.stringify('module') : JSON.stringify('commonjs'), 'process.env.__PACKAGE_VERSION__': JSON.stringify(pkg.version), 'process.env.__COMMIT_HASH__': JSON.stringify(getCommitHash()), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1c72c4df..96c2fb75 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,9 +17,6 @@ importers: '@fast-check/packaged': specifier: '*' version: link:packages/packaged - '@rollup/plugin-replace': - specifier: ^6.0.3 - version: 6.0.3(rollup@4.57.1) '@typescript-eslint/utils': specifier: ^8.56.1 version: 8.56.1(eslint@10.0.2(jiti@1.21.7))(typescript@5.9.3) @@ -2881,15 +2878,6 @@ packages: peerDependencies: rollup: ^1.20.0 || ^2.0.0 - '@rollup/plugin-replace@6.0.3': - resolution: {integrity: sha512-J4RZarRvQAm5IF0/LwUUg+obsm+xZhYnbMXmXROyoSE1ATJe3oXSb9L5MMppdxP2ylNSjv6zFBwKYjcKMucVfA==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - '@rollup/plugin-terser@0.4.4': resolution: {integrity: sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==} engines: {node: '>=14.0.0'} @@ -14050,13 +14038,6 @@ snapshots: magic-string: 0.25.9 rollup: 2.79.2 - '@rollup/plugin-replace@6.0.3(rollup@4.57.1)': - dependencies: - '@rollup/pluginutils': 5.3.0(rollup@4.57.1) - magic-string: 0.30.21 - optionalDependencies: - rollup: 4.57.1 - '@rollup/plugin-terser@0.4.4(rollup@2.79.2)': dependencies: serialize-javascript: 6.0.2 diff --git a/rolldown.common.config.js b/rolldown.common.config.js index ec272db3..e35b427e 100644 --- a/rolldown.common.config.js +++ b/rolldown.common.config.js @@ -1,6 +1,6 @@ import { defineConfig } from 'rolldown'; import { dts } from 'rolldown-plugin-dts'; -import replace from '@rollup/plugin-replace'; +import { replacePlugin } from 'rolldown/plugins'; const inputDir = 'src'; const outputDir = 'lib'; @@ -46,7 +46,7 @@ export default function buildConfigFor(pkg, dirname, replacementsFor) { }, plugins: [ ...sharedOptions.plugins, - ...(replacementsFor !== undefined ? [replace(replacementsFor(true))] : []), + ...(replacementsFor !== undefined ? [replacePlugin(replacementsFor(true), { preventAssignment: true })] : []), dts({ tsconfig: './tsconfig.publish.types.json' }), ], }, @@ -61,7 +61,9 @@ export default function buildConfigFor(pkg, dirname, replacementsFor) { }, plugins: [ ...sharedOptions.plugins, - ...(replacementsFor !== undefined ? [replace(replacementsFor(false))] : []), + ...(replacementsFor !== undefined + ? [replacePlugin(replacementsFor(false), { preventAssignment: true })] + : []), ], }, ] -- 2.51.2