string-replace-loader

JSON →
library 3.3.0 ·javascript
verified May 27, 2026

A Webpack loader that performs string or regex replacements on file contents during the build process. Version 3.3.0 is the latest stable release, with occasional minor/patch updates. It supports plain string replacement, RegExp replacement (via string with flags or RegExp object), multiple replacements in a single rule, callback-based dynamic replacement, and strict mode. Key differentiators: flexible configuration similar to String.prototype.replace, array of replacements, strict mode to ensure replacements occurred. Compared to alternatives like `replace-in-file-webpack-plugin` or `webpack-replace-loader`, this loader integrates directly into the loader chain and works per-file based on test patterns. Requires Webpack 5+ and Node.js 4+.

total hits 16
actors 6 distinct systems
last hit 14h ago AhrefsBot
GPTBot
5
MetaBot
4
Script
1
ClaudeBot
1
Humans
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇬🇧 United Kingdom · 🇩🇪 Germany