Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(replace): The preventAssignment option is treated as a value to replace #1768

Merged
merged 8 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/replace/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function getReplacements(options) {
delete values.sourcemap;
delete values.sourceMap;
delete values.objectGuards;
delete values.preventAssignment;
return values;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
sourcemap: true,
sourceMap: true,
include: '**/input.js',
exclude: 'node_modules/**'
exclude: 'node_modules/**',
preventAssignment: false
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ console.log(`
sourceMap
include
exclude
preventAssignment
`);
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ console.log(`
sourceMap
include
exclude
preventAssignment
`);
1 change: 1 addition & 0 deletions packages/replace/test/snapshots/form.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Generated by [AVA](https://avajs.dev).
sourceMap␊
include␊
exclude␊
preventAssignment␊
\`);`

## process-check: Handles process type guards in replacements
Expand Down
Binary file modified packages/replace/test/snapshots/form.js.snap
Binary file not shown.
Binary file modified packages/replace/test/snapshots/misc.js.snap
Binary file not shown.
Binary file modified packages/replace/test/snapshots/sourcemaps.js.snap
Binary file not shown.
Loading