replace-text-in-bundle-plugin
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"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", |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
39641
330
0