babel-plugin-search-and-replace
Advanced tools
Comparing version 0.3.0 to 1.0.0
@@ -9,3 +9,3 @@ module.exports = () => { | ||
state.opts.map(opt => { | ||
state.opts.rules.map(opt => { | ||
if ( | ||
@@ -12,0 +12,0 @@ typeof opt.search === "object" && |
{ | ||
"name": "babel-plugin-search-and-replace", | ||
"version": "0.3.0", | ||
"version": "1.0.0", | ||
"main": "lib/index.js", | ||
@@ -13,5 +13,5 @@ "repository": "https://github.com/the-smaug/babel-plugin-search-and-replace", | ||
"devDependencies": { | ||
"jest": "21.2.1", | ||
"babel-core": "6.26.0" | ||
"@babel/core": "7.1.0", | ||
"jest": "23.6.0" | ||
} | ||
} |
@@ -16,2 +16,20 @@ # babel-plugin-search-and-replace | ||
{ | ||
"plugins": [["search-and-replace", { | ||
rules: [ | ||
{ | ||
"search": "searchedString", | ||
"replace": "replacement" | ||
}, | ||
{ | ||
"search": /myRegex/, | ||
"replace": "replacement" | ||
} | ||
] | ||
}]] | ||
} | ||
``` | ||
For Babel < 7 use babel-plugin-search-and-replace@0.3.0 | ||
```json | ||
{ | ||
"plugins": [["search-and-replace", [ | ||
@@ -18,0 +36,0 @@ { |
@@ -1,2 +0,2 @@ | ||
const babel = require("babel-core"); | ||
const babel = require("@babel/core"); | ||
const searchAndReplaceplugin = require("../lib/index"); | ||
@@ -26,8 +26,10 @@ | ||
searchAndReplaceplugin, | ||
[ | ||
{ | ||
search: "foo", | ||
replace: "bar" | ||
} | ||
] | ||
{ | ||
rules: [ | ||
{ | ||
search: "foo", | ||
replace: "bar" | ||
} | ||
] | ||
} | ||
] | ||
@@ -44,12 +46,14 @@ ] | ||
searchAndReplaceplugin, | ||
[ | ||
{ | ||
search: "foo", | ||
replace: "bar" | ||
}, | ||
{ | ||
search: "hello", | ||
replace: "hey" | ||
} | ||
] | ||
{ | ||
rules: [ | ||
{ | ||
search: "foo", | ||
replace: "bar" | ||
}, | ||
{ | ||
search: "hello", | ||
replace: "hey" | ||
} | ||
] | ||
} | ||
] | ||
@@ -66,8 +70,10 @@ ] | ||
searchAndReplaceplugin, | ||
[ | ||
{ | ||
search: /el/, | ||
replace: "aze" | ||
} | ||
] | ||
{ | ||
rules: [ | ||
{ | ||
search: /el/, | ||
replace: "aze" | ||
} | ||
] | ||
} | ||
] | ||
@@ -74,0 +80,0 @@ ] |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
96
1
51
4201
5