From 659ed596b256803e14b5bb8c5a2bceb609607696 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 22 Feb 2021 13:55:09 +0000 Subject: [PATCH 1/2] fix(replace): add missing types for new `preventAssignment` option (#813) * fix(replace): add missing types for new `preventAssignment` option closes #812 * chore: trigger ci --- packages/replace/test/types.ts | 1 + packages/replace/types/index.d.ts | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/replace/test/types.ts b/packages/replace/test/types.ts index 20f55160e..28197d689 100755 --- a/packages/replace/test/types.ts +++ b/packages/replace/test/types.ts @@ -16,6 +16,7 @@ const config: RollupOptions = { include: 'config.js', exclude: 'node_modules/**', delimiters: ['<@', '@>'], + preventAssignment: true, VERSION: '1.0.0', ENVIRONMENT: JSON.stringify('development'), __dirname: (id) => `'${dirname(id)}'`, diff --git a/packages/replace/types/index.d.ts b/packages/replace/types/index.d.ts index 642a8c10f..3fe238fd1 100755 --- a/packages/replace/types/index.d.ts +++ b/packages/replace/types/index.d.ts @@ -8,7 +8,11 @@ export interface RollupReplaceOptions { * All other options are treated as `string: replacement` replacers, * or `string: (id) => replacement` functions. */ - [str: string]: Replacement | RollupReplaceOptions['include'] | RollupReplaceOptions['values']; + [str: string]: + | Replacement + | RollupReplaceOptions['include'] + | RollupReplaceOptions['values'] + | RollupReplaceOptions['preventAssignment']; /** * A minimatch pattern, or array of patterns, of files that should be @@ -24,6 +28,11 @@ export interface RollupReplaceOptions { * of `foo`, supply delimiters */ delimiters?: [string, string]; + /** + * Prevents replacing strings where they are followed by a single equals + * sign. + */ + preventAssignment?: boolean; /** * You can separate values to replace from other options. */ From 4a11bbd4de64085b2245cf98ef3b4cd51233a76e Mon Sep 17 00:00:00 2001 From: shellscape Date: Mon, 22 Feb 2021 12:36:35 -0500 Subject: [PATCH 2/2] chore(release): replace v2.4.1 --- packages/replace/CHANGELOG.md | 8 ++++++++ packages/replace/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/replace/CHANGELOG.md b/packages/replace/CHANGELOG.md index 46746016e..9994d28fa 100755 --- a/packages/replace/CHANGELOG.md +++ b/packages/replace/CHANGELOG.md @@ -1,5 +1,13 @@ # @rollup/plugin-replace ChangeLog +## v2.4.1 + +_2021-02-22_ + +### Bugfixes + +- fix: add missing types for new `preventAssignment` option (#813) + ## v2.4.0 _2021-02-22_ diff --git a/packages/replace/package.json b/packages/replace/package.json index 2100aee80..fa9c415f1 100644 --- a/packages/replace/package.json +++ b/packages/replace/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/plugin-replace", - "version": "2.4.0", + "version": "2.4.1", "publishConfig": { "access": "public" },