{"_id":"webpack-plugin-replace","_rev":"8-a94164ea22234b394f8440591e7dd14f","name":"webpack-plugin-replace","dist-tags":{"latest":"1.2.0"},"versions":{"0.0.0":{"name":"webpack-plugin-replace","version":"0.0.0","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"gitHead":"aaa80c6dbb4980b64f529f9e6b808dea0596a917","_id":"webpack-plugin-replace@0.0.0","_shasum":"246a7c83f388aafe1092cbbe2dc1432b44ae2ab4","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"246a7c83f388aafe1092cbbe2dc1432b44ae2ab4","tarball":"https://registry.npmjs.org/webpack-plugin-replace/-/webpack-plugin-replace-0.0.0.tgz","integrity":"sha512-zBmzCd6JK8Qmz8P68un7yT7F8FUrlSBtzvaI2t1ZL0g6o0DCh7hdtJma3d57044D7UcyFgcaJFdPkwH1Hxyf0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFIT/hrbkSoLWGOD5D4wp84xkqpx0UPTi+8bSFE/HTG9AiBHsbYB/yH2ICQGrqPBvl/6yaE8gRHnaJ4PjISHqHG58Q=="}]},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webpack-plugin-replace-0.0.0.tgz_1496387370667_0.6179499165154994"},"directories":{}},"1.0.0":{"name":"webpack-plugin-replace","description":"Replace content while bundling.","version":"1.0.0","main":"lib/index.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"scripts":{"pretest":"node test/build","test":"tape test/index.js | tap-spec"},"keywords":["bundle","content","plugin","replace","string","text","webpack","webpack-plugin"],"files":["lib"],"engines":{"node":">=4"},"devDependencies":{"mri":"^0.1.0","rimraf":"^2.6.1","tap-spec":"^4.1.1","tape":"^4.6.3","webpack":"^2.6.1"},"gitHead":"aced18830d2bd0b303fdd6e8b2dcf7f06c40176c","_id":"webpack-plugin-replace@1.0.0","_shasum":"f205136b37c72e1c8c7727fc44b72b3b96d49a8f","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"f205136b37c72e1c8c7727fc44b72b3b96d49a8f","tarball":"https://registry.npmjs.org/webpack-plugin-replace/-/webpack-plugin-replace-1.0.0.tgz","integrity":"sha512-ag90eGqG4+D0iE3bLKE/fonGx17REg+WQ+RU/nrYu7FVRuSk+3BNhOVvyLofUiulduiEHe6eYUuHuW4/9eMxaQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHsMdWrIECukAlnrk8v01/saPLP/id3gygZPUud+23lsAiBOihQXP98AvK2v4Jr2LOML+9i59AIWPvArE5meU6BaSA=="}]},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webpack-plugin-replace-1.0.0.tgz_1496539134588_0.4762946725822985"},"directories":{}},"1.0.1":{"name":"webpack-plugin-replace","description":"Replace content while bundling.","version":"1.0.1","main":"lib/index.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"scripts":{"pretest":"node test/build","test":"tape test/index.js | tap-spec"},"keywords":["bundle","content","plugin","replace","string","text","webpack","webpack-plugin"],"files":["lib"],"engines":{"node":">=4"},"devDependencies":{"mri":"^0.1.0","rimraf":"^2.6.1","tap-spec":"^4.1.1","tape":"^4.6.3","webpack":"^2.6.1"},"gitHead":"f8b11c123ade0d4335930e420cebb4ddce75878e","_id":"webpack-plugin-replace@1.0.1","_shasum":"0bb0af69b20d6885b4c0738c7579844776da8ec8","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"0bb0af69b20d6885b4c0738c7579844776da8ec8","tarball":"https://registry.npmjs.org/webpack-plugin-replace/-/webpack-plugin-replace-1.0.1.tgz","integrity":"sha512-qyhK+fz63KYp1JMRXDX2rwC5yNU3l7R0/cbLYjFRJK7It03B8E7zocHHZVFoOkm5RgOVESLRA2VzqENsJjYfBg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD46IMu6OgKUx3mWskrpz5q3u1i6ovzUs9rqi5IXe9oSwIhAPkJ9U90rDpCd/WZnoqmRsh773vhhlu9RgJR8DYWXFXx"}]},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webpack-plugin-replace-1.0.1.tgz_1496551056621_0.21074488409794867"},"directories":{}},"1.1.0":{"name":"webpack-plugin-replace","description":"Replace content while bundling.","version":"1.1.0","main":"lib/index.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"scripts":{"pretest":"node test/build","test":"tape test/index.js | tap-spec"},"keywords":["bundle","content","plugin","replace","string","text","webpack","webpack-plugin"],"files":["lib"],"engines":{"node":">=4"},"devDependencies":{"mri":"^0.1.0","rimraf":"^2.6.1","tap-spec":"^4.1.1","tape":"^4.6.3","webpack":"^2.6.1"},"gitHead":"c916edbcb0dff93af96fb10560580e6a340b9f7c","_id":"webpack-plugin-replace@1.1.0","_shasum":"765157eb5c2b1d3e8e162c5440424c4254a228ab","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"765157eb5c2b1d3e8e162c5440424c4254a228ab","tarball":"https://registry.npmjs.org/webpack-plugin-replace/-/webpack-plugin-replace-1.1.0.tgz","integrity":"sha512-KT6M7Q9/TQ+hJ4itRmdhwucaPSfPNUIjbUl524psMEQBaNgFu8B+L8RF6C+Yf6XS8FfHYP2SOKaxLuSAKUvA6g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsXxS/a5TvKudsXSGGVj420ibQ6XTLrhaHYIZ0suQRrwIhAI+SjwlC3p0BNhW7htfmrcj3ACceydcxtxY1kKgvTHUZ"}]},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webpack-plugin-replace-1.1.0.tgz_1496605238597_0.2741791419684887"},"directories":{}},"1.1.1":{"name":"webpack-plugin-replace","description":"Replace content while bundling.","version":"1.1.1","main":"lib/index.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"scripts":{"pretest":"node test/build","test":"tape test/index.js | tap-spec"},"keywords":["bundle","content","plugin","replace","string","text","webpack","webpack-plugin"],"files":["lib"],"engines":{"node":">=4"},"devDependencies":{"mri":"^0.1.0","rimraf":"^2.6.1","tap-spec":"^4.1.1","tape":"^4.6.3","webpack":"^2.6.1"},"gitHead":"63806d32e62220d6f77d58c44c298a1ec42629c6","_id":"webpack-plugin-replace@1.1.1","_shasum":"9816647fefc98a7d1700f93f2b4b6f481cf20161","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"9816647fefc98a7d1700f93f2b4b6f481cf20161","tarball":"https://registry.npmjs.org/webpack-plugin-replace/-/webpack-plugin-replace-1.1.1.tgz","integrity":"sha512-qDhex8TT3PHbKYBaxGD/PRutGsFc2QR4xcbPLzr1I303/kz/1J1ZlgGBFoICKFlAg25neDDitzANDF+5H+OeeQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHV3oWm2seo4stmr/ZNoIkfZoPW2qu93WkUXUkT/YhzDAiEAqVNdTpgRwJz4vd7m/lcbzHRnhVxGtSfXAq1hdLs4pLc="}]},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webpack-plugin-replace-1.1.1.tgz_1496689612396_0.15504624252207577"},"directories":{}},"1.2.0":{"name":"webpack-plugin-replace","description":"Replace content while bundling.","version":"1.2.0","main":"lib/index.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"scripts":{"pretest":"node test/build","test":"tape test/index.js | tap-spec"},"keywords":["bundle","content","plugin","replace","string","text","webpack","webpack-plugin"],"engines":{"node":">=4"},"devDependencies":{"mri":"^0.1.0","rimraf":"^2.6.1","tap-spec":"^4.1.1","tape":"^4.6.3","webpack":"^2.6.1"},"gitHead":"2afc6a007437eb726fd5f3a7817aabdef2b9044c","_id":"webpack-plugin-replace@1.2.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"integrity":"sha512-1HA3etHpJW55qonJqv84o5w5GY7iqF8fqSHpTWdNwarj1llkkt4jT4QSvYs1hoaU8Lu5akDnq/spHHO5mXwo1w==","shasum":"3f20db96237400433231e35ea76d9be3f7128916","tarball":"https://registry.npmjs.org/webpack-plugin-replace/-/webpack-plugin-replace-1.2.0.tgz","fileCount":4,"unpackedSize":6377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcS2XjCRA9TVsSAnZWagAA2+YP/3r196BX01RHH46KxmvW\nayWCCv/FOpOC57LiCWLM+lD+vCMxZPz7XNGhb3niAbESLFP91tGEPSkwTkiP\nZMJt8cjQQ1jQdQ6rmv3ztLuz9ihwlc42TKc0UFu50AjjnOEmpBr3XJCHsEkU\nILVYbAG7XeY4vY++HRFHjUTm6KVkXm2zdafqpzYPIxESYocqIN29U9CehohZ\nUV4OZPyDb/5ya9isfPJbOkylTgLpFPGjWu02nW67v0LfYQYJ7y5OFE5bbIlU\nttYhU3ENbDygHwuKVzt81THND7w4aUw8+57ToJdLaFbSvd1qcIEVw3NkBtzM\ncZ6NJ3QErWLRdSUfQTSrDRs4fhgQZQZqyp8emPln2i84QyFTYkBU5SvV2H3V\noX5a7rM7x5lhR5LEH+djt0oXDJndz9djjdBDq2p6/ta4rOknnOAOUbEZP0Gf\n6E7vW6oJ/GNLjkMMYe0fkTBT/nbrSbA71RzmwgFnZX4WJZpLWpUao/oqFKWk\ngcAh2QwW42UznsIgvJMQDTT23yuhZKRlgJNzuwUzrE6J3w1ODrIbZXYCtw7V\nAgR2PRUhSEmOOxNIvwsnAOaZZG1ZOLDFE1y8p/HyWPCoSsn32Rjusu7MGLGF\nqY0KZw4PFpv6lE7j2P/HckvYcPfB2ugGsKCsa/Pi8Pz4xkVRnGy6Vrr8GpYl\nOueX\r\n=7IdW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBS8c44KtJnoj62tuPvTt3bxrMMIutRmpwOYYtX+SBz0AiEAx+rAIn5SCZ3YYCrJdLXzwpYcmsF/NrqBblwmaedUEe8="}]},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webpack-plugin-replace_1.2.0_1548445154809_0.9712287330059131"},"_hasShrinkwrap":false}},"readme":"# webpack-plugin-replace [![Build Status](https://travis-ci.org/lukeed/webpack-plugin-replace.svg?branch=master)](https://travis-ci.org/lukeed/webpack-plugin-replace)\n\n> Replace content while bundling.\n\n\n## Install\n\n```\n$ npm install --save-dev webpack-plugin-replace\n```\n\n\n## Usage\n\n```js\n// webpack.config.js\nconst ReplacePlugin = require('webpack-plugin-replace');\n\nmodule.exports = {\n  // ...\n  plugins: [\n    new ReplacePlugin({\n      exclude: [\n        'foo.js',\n        /node_modules/,\n        filepath => filepath.includes('ignore')\n      ],\n      patterns: [{\n        regex: /throw\\s+(new\\s+)?(Type|Reference)?Error\\s*\\(/g,\n        value: 'return;('\n      }],\n      values: {\n        'process.env.NODE_ENV': JSON.stringify('production'),\n        'FOO_BAR': '\"hello world\"',\n        'DEV_MODE': false,\n      }\n    })\n  ]\n};\n```\n\n\n## API\n\n### webpack-plugin-replace(options)\n\n#### options.exclude\n\nType: `Array|String|Function|RegExp`<br>\nDefault: `false`\n\nIf multiple conditions are provided, matching _any_ condition will exclude the filepath, which prevents any alterations.\n\n> **Note:** By default, nothing is excluded!\n\n#### options.include\n\nType: `Array|String|Function|RegExp`<br>\nDefault: `true`\n\nIf multiple conditions are provided, matching _any_ condition will include & scan the filepath for eligible replacements.\n\n> **Note:** By default, all filepaths are included!\n\n#### options.patterns\n\nType: `Array`<br>\nDefault: `[]`\n\nAn array of `RegExp` pattern definitions. Each definition is an object with `regex <RegExp>` and `value <String|Function>` keys. If `value` is a function, it takes the same arguments as [`String.prototype.relace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_function_as_a_parameter).\n\n#### options.values\n\nType: `Object`<br>\nDefault: `{}`\n\nAn object whose keys are `strings` that should be replaced and whose values are `strings` the replacements.\n\nIf desired, you may forgo the `values` key & declare your `key:value` pairs directly to the main configuration. For example:\n\n```js\n{\n  exclude: /node_modules/,\n  values: {\n    'process.env.NODE_ENV': JSON.stringify('production'),\n  }\n}\n\n// is the same as:\n\n{\n  exclude: /node_modules/,\n  'process.env.NODE_ENV': JSON.stringify('production'),\n}\n```\n\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"time":{"modified":"2022-06-29T00:02:50.819Z","created":"2017-06-02T07:09:32.144Z","0.0.0":"2017-06-02T07:09:32.144Z","1.0.0":"2017-06-04T01:18:55.525Z","1.0.1":"2017-06-04T04:37:37.576Z","1.1.0":"2017-06-04T19:40:38.674Z","1.1.1":"2017-06-05T19:06:52.533Z","1.2.0":"2019-01-25T19:39:15.021Z"},"keywords":["bundle","content","plugin","replace","string","text","webpack","webpack-plugin"],"readmeFilename":"readme.md","description":"Replace content while bundling.","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"license":"MIT"}