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. */