babel-plugin-transform-remove-imports
Advanced tools
Comparing version 1.0.8 to 1.2.0
@@ -8,4 +8,3 @@ "use strict"; | ||
function _default(_ref) { | ||
var t = _ref.types; | ||
function _default() { | ||
return { | ||
@@ -16,2 +15,7 @@ name: "transform-remove-imports", | ||
ImportDeclaration: function ImportDeclaration(path, state) { | ||
if (state.opts.removeAll) { | ||
path.remove(); | ||
return; | ||
} | ||
if (!state.opts.test) return; | ||
@@ -18,0 +22,0 @@ if (!path.node.source || !path.node.source.value) return; |
{ | ||
"name": "babel-plugin-transform-remove-imports", | ||
"version": "1.0.8", | ||
"version": "1.2.0", | ||
"description": "Remove the specified import declaration when you use the babel transform to build the package.", | ||
@@ -8,2 +8,3 @@ "repository": "https://github.com/uiwjs/babel-plugin-transform-remove-imports", | ||
"scripts": { | ||
"prepare": "npm run build", | ||
"test": "jest --coverage", | ||
@@ -43,4 +44,8 @@ "test:watch": "jest --watchAll --coverage", | ||
}, | ||
"files": [ | ||
"lib", | ||
"index.d.ts" | ||
], | ||
"author": "Kenny Wong", | ||
"license": "MIT" | ||
} |
@@ -50,6 +50,11 @@ babel-plugin-transform-remove-imports | ||
## Optiosn | ||
- `test: string` Matches based on regular expressions. | ||
- `removeAll: boolean` Delete all import packages. | ||
## Programatic Usage | ||
```js | ||
import plugin from 'babel-plugin-transform-rename-import' | ||
import plugin from 'babel-plugin-transform-remove-imports' | ||
import { transform } from 'babel-core' | ||
@@ -56,0 +61,0 @@ |
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
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
3713
23
76
4