Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@nutui/babel-plugin-separate-import
Advanced tools
按需引入Nutui2.0组件,减小打包体积;
npm i -D @nutui/babel-plugin-separate-import
配置.babelrc
文件:
{
"plugins": [
["@nutui/babel-plugin-separate-import", {
"libraryName": "@nutui/nutui2",
"libraryDirectory": "dist/src/packages",
"style": "css"
}]
]
}
然后就可以像下面这样按需引入组件了:
import Vue from 'vue';
import { Button, Icon } from '@nutui/nutui2';
Vue.component(Button.name, Button);
Vue.component(Icon.name, Icon);
import { Button } from '@nutui/nutui2';
当使用这种方式import
组件时,将会被转换为:
import Button from '@nutui/nutui/dist/src/packages/button/button.vue';
import '@nutui/nutui/dist/src/packages/button/button.css';
如果style
选项为css
,则会加载相应组件的css
;
如果style
选项为scss
,则会加载相应组件的scss
;
如果没有style
选项,则不会加载样式文件,需用户手动添加;
FAQs
按需构建nutui2.0的组件,减小打包体积
The npm package @nutui/babel-plugin-separate-import receives a total of 12 weekly downloads. As such, @nutui/babel-plugin-separate-import popularity was classified as not popular.
We found that @nutui/babel-plugin-separate-import demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.