@rollup/plugin-replace
Advanced tools
Comparing version 2.4.2 to 3.0.0
# @rollup/plugin-replace ChangeLog | ||
## v3.0.0 | ||
_2021-07-16_ | ||
### Breaking Changes | ||
- fix | ||
## v2.4.2 | ||
@@ -124,2 +132,2 @@ | ||
- First release | ||
- First release |
@@ -58,3 +58,3 @@ 'use strict'; | ||
) | ||
: new RegExp(("\\b(" + (keys.join('|')) + ")\\b" + lookahead), 'g'); | ||
: new RegExp(("\\b(" + (keys.join('|')) + ")\\b(?!\\.)" + lookahead), 'g'); | ||
@@ -61,0 +61,0 @@ return { |
@@ -52,3 +52,3 @@ import MagicString from 'magic-string'; | ||
) | ||
: new RegExp(("\\b(" + (keys.join('|')) + ")\\b" + lookahead), 'g'); | ||
: new RegExp(("\\b(" + (keys.join('|')) + ")\\b(?!\\.)" + lookahead), 'g'); | ||
@@ -55,0 +55,0 @@ return { |
{ | ||
"name": "@rollup/plugin-replace", | ||
"version": "2.4.2", | ||
"version": "3.0.0", | ||
"publishConfig": { | ||
@@ -9,3 +9,6 @@ "access": "public" | ||
"license": "MIT", | ||
"repository": "rollup/plugins", | ||
"repository": { | ||
"url": "rollup/plugins", | ||
"directory": "packages/replace" | ||
}, | ||
"author": "Rich Harris <richard.a.harris@gmail.com>", | ||
@@ -18,14 +21,11 @@ "homepage": "https://github.com/rollup/plugins/tree/master/packages/replace#readme", | ||
"build": "rollup -c", | ||
"ci:coverage": "nyc pnpm run test && nyc report --reporter=text-lcov > coverage.lcov", | ||
"ci:lint": "pnpm run build && pnpm run lint", | ||
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov", | ||
"ci:lint": "pnpm build && pnpm lint", | ||
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}", | ||
"ci:test": "pnpm run test -- --verbose && pnpm run test:ts", | ||
"lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", | ||
"lint:docs": "prettier --single-quote --arrow-parens avoid --trailing-comma none --write README.md", | ||
"lint:js": "eslint --fix --cache src test types --ext .js,.ts", | ||
"lint:package": "prettier --write package.json --plugin=prettier-plugin-package", | ||
"ci:test": "pnpm test -- --verbose && pnpm test:ts", | ||
"prebuild": "del-cli dist", | ||
"prepare": "pnpm run build", | ||
"prepublishOnly": "pnpm run lint && pnpm run test", | ||
"pretest": "pnpm run build", | ||
"prepare": "if [ ! -d 'dist' ]; then pnpm build; fi", | ||
"prerelease": "pnpm build", | ||
"pretest": "pnpm build", | ||
"release": "pnpm plugin:release --workspace-root -- --pkg $npm_package_name", | ||
"test": "ava", | ||
@@ -32,0 +32,0 @@ "test:ts": "tsc types/index.d.ts test/types.ts --noEmit" |
@@ -64,6 +64,11 @@ [npm]: https://img.shields.io/npm/v/@rollup/plugin-replace | ||
Type: `Array[...String, String]`<br> | ||
Default: `['\b', '\b']` | ||
Default: `['\b', '\b(?!\.)']` | ||
Specifies the boundaries around which strings will be replaced. By default, delimiters are [word boundaries](https://www.regular-expressions.info/wordboundaries.html). See [Word Boundaries](#word-boundaries) below for more information. | ||
Specifies the boundaries around which strings will be replaced. By default, delimiters are [word boundaries](https://www.regular-expressions.info/wordboundaries.html) and also prevent replacements of instances with nested access. See [Word Boundaries](#word-boundaries) below for more information. | ||
For example, if you pass `typeof window` in `values` to-be-replaced, then you could expect the following scenarios: | ||
- `typeof window` **will** be replaced | ||
- `typeof window.document` **will not** be replaced due to `(?!\.)` boundary | ||
- `typeof windowSmth` **will not** be replaced due to a `\b` boundary | ||
### `preventAssignment` | ||
@@ -70,0 +75,0 @@ |
@@ -49,3 +49,3 @@ import MagicString from 'magic-string'; | ||
) | ||
: new RegExp(`\\b(${keys.join('|')})\\b${lookahead}`, 'g'); | ||
: new RegExp(`\\b(${keys.join('|')})\\b(?!\\.)${lookahead}`, 'g'); | ||
@@ -52,0 +52,0 @@ return { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
193
20588
7