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.0 to 2.1.1

2

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

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

@@ -36,6 +36,12 @@ # vite-plugin-fast-external

// Custom external code by function
'@scope/name': () => `const Lib = window.ScopeName.Member; export default Lib;`,
// Support nesting module name
// Support custom external code by function
'@namespace/lib-name': () => `
const lib = window.LibName;
export default lib;
export const Message = lib.Message
export const Notification = lib.Notification;
`,
// Read a template file and return Promise<string>
// Load a template file and return Promise<string>
externalId: () => require('fs/promises').readFile('path', 'utf-8'),

@@ -42,0 +48,0 @@

@@ -37,6 +37,11 @@ # vite-plugin-fast-external

// 支持包命名空间,通过函数可以自定义返回任何代码段 - 但你要知道 vite 开发期只支持 ESM
'@scope/name': () => `const Lib = window.ScopeName.Member; export default Lib;`,
'@namespace/lib-name': () => `
const lib = window.LibName;
export default lib;
export const Message = lib.Message
export const Notification = lib.Notification;
`,
// 还支持返回 Promise<string> 很容易配合文件、网络等 IO
externalId: async () => await require('fs').promises.readFile('path', 'utf-8'),
externalId: () => require('fs/promises').readFile('path', 'utf-8'),

@@ -43,0 +48,0 @@ // 在 Electron 渲染进程中使用

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