Produces undefined if `values` is empty or undefined
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- javascript, webpack
- Domain
- build-system
Research direction
Start from the ReplacePlugin implementation that builds the replacement regular expression and invokes replace on the file content. Reproduce the issue with the configuration shown and verify that an empty or undefined values collection leaves the original content unchanged rather than producing undefined output.
Written by the indexing model from the issue text.
Description
If values is not specified result is always a bunch of undefined
new ReplacePlugin({
include: /serviceManager/,
patterns: [
{
regex: /var IS_WEB = [^;]+;/,
value: 'var IS_WEB = true;'
}
]
})
Calls on file content:
mod._source._value.replace(/(?:)/g, k => vals[k]);
Can be easily fixed:
if(keys.length) {
mod._source._value.replace(REGEXP, k => vals[k]);
}
- Dominant language
- JavaScript
- Stars
- 36
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lukeed/webpack-plugin-replace
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
lukeed/webpack-plugin-replace#5 · 1 comment ·
-
Update for Webpack 4Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
lukeed/webpack-plugin-replace#4 · 2 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
All issues in lukeed/webpack-plugin-replace
Similar issues
-
Scrub the retired Kaizen target out of the deploy runbookPossibly taken @mcannonbrookes claimed this today. Opendocumentation
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
atlassian-labs/roving-office#25 ·
Maintainers usually reply within 1 day
-
Remove the unused Forward Template editor from Messages settingsPossibly taken @atomantic claimed this today. Openarea:ui bug effort:low incomplete model:light plan planner:gpt-6-1-sol
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
documentation good first issue hacktoberfest size/small type/docs up-for-grabs
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Redo-San/RedoSan-Authenticity#511 ·
Maintainers usually reply within 1 day
-
Kitchen Inventory Tracker Step 10 does not identify the function call in its examplePossibly taken @aminajao claimed this today. Openhelp wanted python v9 cert scope: curriculum
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
freeCodeCamp/freeCodeCamp#70604 ·
Maintainers usually reply within 1 day