New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

replace-text-in-bundle-plugin

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

replace-text-in-bundle-plugin - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

6

package.json
{
"name": "replace-text-in-bundle-plugin",
"version": "1.0.1",
"version": "1.0.2",
"description": "Webpack plugin that replaces a specified string with a specified value in a specified bundle file",
"main": "./dist/umd/index.js",
"module": "./dist/esm/index.js",
"repository": {
"type": "git",
"url": "https://github.com/mohit-raj-purohit/ReplaceTextInBundlePlugin"
},
"scripts": {

@@ -8,0 +12,0 @@ "version:patch": "npm version patch",

9

src/index.ts
import {Compiler, Compilation} from 'webpack';
import {Option} from './constants';
import {getBundleSource, updateBundleSource, replaceText, escapeSpecialCharacters} from './utils';
import {
getBundleSource,
updateBundleSource,
replaceText,
escapeSpecialCharacters,
} from './utils';

@@ -40,3 +45,3 @@ class ReplaceTextInBundlePlugin {

const bundleSource = getBundleSource(compilation, bundle);
const escapedFrom = escapeSpecialCharacters(from);
const escapedFrom = escapeSpecialCharacters(from);
const modifiedBundleSource = replaceText(bundleSource, escapedFrom, to);

@@ -43,0 +48,0 @@ updateBundleSource(compilation, bundle, modifiedBundleSource);

@@ -11,5 +11,5 @@ export function replaceText(source: string, from: string, to: string): string {

replaceText,
escapeSpecialCharacters
escapeSpecialCharacters,
};
export default utils;
export default utils;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc