Socket
Socket
Sign inDemoInstall

vite-plugin-fast-external

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-fast-external - npm Package Compare versions

Comparing version 2.1.2 to 2.2.0

presets/ant-design-vue-v1.js

8

package.json
{
"name": "vite-plugin-fast-external",
"version": "2.1.2",
"version": "2.2.0",
"description": "Without lexical transform, support custom external code.",

@@ -21,4 +21,8 @@ "main": "index.js",

"plugin",
"external"
"external",
"vue",
"react",
"antd",
"element"
]
}

@@ -10,2 +10,3 @@ # vite-plugin-fast-external

🌱 Support custom external code
📦 Built in Vue, React, Antd, Element and others, Out of the box

@@ -35,9 +36,44 @@ **English | [简体中文](https://github.com/caoxiemeihao/vite-plugins/blob/main/packages/fast-external/README.zh-CN.md)**

vue: 'Vue',
})
]
}),
],
}
```
#### Customize
#### Builtins
You can easily use some builtin modules
```js
import external from 'vite-plugin-fast-external';
import {
antd_vue_v1,
antd_vue_v3,
antd_v4,
element_plus,
element_ui,
react_dom_v17,
react_dom_v18,
react_v17,
react_v18,
vue_v2,
vue_v3,
} from 'vite-plugin-fast-external/presets';
export default {
plugins: [
external({
'ant-design-vue': antd_vue_v3,
antd: antd_v4,
'element-plus': element_plus,
'element-ui': element_ui,
'react-dom': react_dom_v18,
react: react_v18,
vue: vue_v3,
}),
],
}
```
#### Customize (Advance)
Support custom external code by function

@@ -47,11 +83,9 @@

external({
'element-ui': () => `
const E = window.ELEMENT;
export { E as default };
export const Loading = E.Loading;
export const Message = E.Message;
export const MessageBox = E.MessageBox;
export const Notification = E.Notification;
module: () => `
const M = window.Module;
const D = M.default || M;
export { D as default };
export const member1 = M.member1;
// other members...
`,
// ...other element-ui members
})

@@ -58,0 +92,0 @@ ```

# vite-plugin-fast-external
[![npm package](https://nodei.co/npm/vite-plugin-fast-external.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/vite-plugin-fast-external)
<br/>
[![NPM version](https://img.shields.io/npm/v/vite-plugin-fast-external.svg?style=flat)](https://npmjs.org/package/vite-plugin-fast-external)
[![NPM Downloads](https://img.shields.io/npm/dm/vite-plugin-fast-external.svg?style=flat)](https://npmjs.org/package/vite-plugin-fast-external)
🚀 **高性能** 不需要语法转换
🚀 **高性能** 不需要语法转换
🌱 支持自定义 external 代码段
📦 内置 Vue, React, Antd, Element 等等, 开箱即用

@@ -34,9 +33,44 @@ **[English](https://github.com/caoxiemeihao/vite-plugins/tree/main/packages/fast-external#readme) | 简体中文**

vue: 'Vue',
})
]
}),
],
})
```
#### 自定义
#### 内置模块
已经内置的一些常用的模块
```js
import external from 'vite-plugin-fast-external';
import {
antd_vue_v1,
antd_vue_v3,
antd_v4,
element_plus,
element_ui,
react_dom_v17,
react_dom_v18,
react_v17,
react_v18,
vue_v2,
vue_v3,
} from 'vite-plugin-fast-external/presets';
export default {
plugins: [
external({
'ant-design-vue': antd_vue_v3,
antd: antd_v4,
'element-plus': element_plus,
'element-ui': element_ui,
'react-dom': react_dom_v18,
react: react_v18,
vue: vue_v3,
}),
],
}
```
#### 自定义(高级部分)
支持通过 function 返回自定义 external 代码

@@ -46,11 +80,9 @@

external({
'element-ui': () => `
const E = window.ELEMENT;
export { E as default };
export const Loading = E.Loading;
export const Message = E.Message;
export const MessageBox = E.MessageBox;
export const Notification = E.Notification;
module: () => `
const M = window.Module;
const D = M.default || M;
export { D as default };
export const member1 = M.member1;
// 其他成员...
`,
// ...其他 element-ui 导出成员
})

@@ -57,0 +89,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