New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nutui/babel-plugin-separate-import

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nutui/babel-plugin-separate-import - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

2

package.json
{
"name": "@nutui/babel-plugin-separate-import",
"version": "0.1.7",
"version": "0.1.8",
"description": "按需构建nutui2.0的组件,减小打包体积",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -25,3 +25,3 @@ ### @nutui/babel-plugin-separate-import

["@nutui/babel-plugin-separate-import", {
"style": "css"
"style": "css"
}]

@@ -39,2 +39,14 @@ ]

Vue.use(Button);
Vue.use(Icon);
```
### 国际化
如果您需要使用我们的国际化功能,并使用我们的语言转换方法来对自己的网站进行语言转换的话,需要配置该插件的 `sourceCode` 参数为 `true`;此时组件的按需引用和默认情况下不同,组件将会指向未构建的源文件,同时组件也不再具有 `install` 方法,请使用 `Vue.component` 对组件进行注册;
```js
import Vue from 'vue';
import { Button, Icon, locale, i18n } from '@nutui/nutui';
Vue.component(Button.name, Button);

@@ -44,2 +56,14 @@ Vue.component(Icon.name, Icon);

```js
// .babelrc
{
"plugins": [
["@nutui/babel-plugin-separate-import", {
"source": true,
"style": "css"
}]
]
}
### AST转换

@@ -54,3 +78,6 @@

```js
import Button from '@nutui/nutui/dist/packages/button/button.js';
// sourceCode 为 true 时
import Button from '@nutui/nutui/dist/packages/button/button.vue';
import '@nutui/nutui/dist/packages/button/button.css';

@@ -57,0 +84,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc