Installations
npm install babel-plugin-const-replace-import
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
10.15.3
NPM Version
6.4.1
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
neitherzhu
Download Statistics
Total Downloads
876
Last Day
1
Last Week
1
Last Month
10
Last Year
75
GitHub Statistics
3 Stars
3 Commits
2 Watching
1 Branches
1 Contributors
Bundle Size
834.00 B
Minified
410.00 B
Minified + Gzipped
Package Meta Information
Latest Version
0.0.2
Package Id
babel-plugin-const-replace-import@0.0.2
Unpacked Size
3.65 kB
Size
1.45 kB
File Count
3
NPM Version
6.4.1
Node Version
10.15.3
Total Downloads
Cumulative downloads
Total Downloads
876
Last day
0%
1
Compared to previous day
Last week
-83.3%
1
Compared to previous week
Last month
25%
10
Compared to previous month
Last year
-53.7%
75
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No dependencies detected.
babel-plugin-const-replace-import
将通过import的方式引入的指定类库转换成const的方式
Install
Using npm:
1npm install --save-dev babel-plugin-const-replace-import
Usage
在.babelrc
的plugins
中增加代码
1"plugins": [ 2 ["babel-plugin-const-replace-import", { 3 "libraries": { 4 "react": "React", 5 "react-dom": "ReactDOM", 6 "react-redux": "ReactRedux", 7 "redux": "Redux", 8 "react-router-dom": "ReactRouterDOM", 9 "redux-actions": "ReduxActions", 10 "react-loadable": "ReactLoadable", 11 "moment": "moment", 12 "antd": "antd", 13 "axios": "axios" 14 } 15 }],
Example
源码:
1import React, { Component, } from 'react' 2import { connect, } from 'react-redux' 3 4class TestComponent extends Component { 5 render() { 6 return <div>TestComponent</div> 7 } 8} 9 10export default ContractManage
转换后
1const React = window.React 2const { Component, } = window.React 3const { connect, } = window.ReactRedux 4 5class TestComponent extends Component { 6 render() { 7 return <div>TestComponent</div> 8 } 9} 10 11export default ContractManage
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/3 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
2.6
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More