Repository navigation
[@rollup/plugin-replace] options values explicitly passed undefined value #1953
Replies: 1 comment
|
Not really intended, but it's how the shorthand works. The plugin accepts replacements either under function getReplacements(options) {
if (options.values) return Object.assign({}, options.values);
const values = Object.assign({}, options);
delete values.delimiters;
delete values.include;
// ... deletes the other known options
return values;
}So when The easy fix is to never pass it through as replace({
preventAssignment: true,
values: myValues ?? {},
})With |
Uh oh!
There was an error while loading. Please reload this page.
When
options.valuesexplicitly passedundefinedvalue, it will replace allvalues, is this intended ?All reactions