vite-plugin-fast-external
Advanced tools
Comparing version 2.1.0 to 2.1.1
{ | ||
"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 渲染进程中使用 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5960
64