You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/replace/README.md
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -114,6 +114,31 @@ Default: `null`
114
114
115
115
A [minimatch pattern](https://github.com/isaacs/minimatch), or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.
116
116
117
+
### `values`
118
+
119
+
Type: `{ [key: String]: Replacement }`, where `Replacement` is either a string or a `function` that returns a string.
120
+
Default: `{}`
121
+
122
+
To avoid mixing replacement strings with the other options, you can specify replacements in the `values` option. For example, the following signature:
123
+
124
+
```js
125
+
replace({
126
+
include: ["src/**/*.js"],
127
+
changed:"replaced"
128
+
});
129
+
```
130
+
131
+
Can be replaced with:
132
+
133
+
```js
134
+
replace({
135
+
include: ["src/**/*.js"],
136
+
values: {
137
+
changed:"replaced"
138
+
}
139
+
});
140
+
```
141
+
117
142
## Word Boundaries
118
143
119
144
By default, values will only match if they are surrounded by _word boundaries_.
0 commit comments