Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vite-plugin-lazy-import

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-lazy-import - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

19

dist/index.js

@@ -113,6 +113,9 @@ (function (global, factory) {

exports.forEach(function (item) {
var importName = item.ln || item.n;
var importName = item.n;
var variableCode = item.n;
if (item.ln !== item.n) {
variableCode = "".concat(importName, " as ").concat(item.n);
var asName = '';
if (item.ln && item.ln !== item.n) {
importName = item.ln;
asName = item.n;
variableCode = "".concat(importName, " as ").concat(asName);
}

@@ -164,2 +167,9 @@ var jsPath = '';

}
function toVariableExport(impCode) {
var rest = impCode.replace(/\n/, ' ').match(/\{[a-zA-Z,_'"\s]+?\}/);
if (rest) {
return "export ".concat(rest[0]);
}
return '';
}
return {

@@ -183,3 +193,4 @@ name: 'vite:lazy-import',

}
var exports = (0, _esModuleLexer.parse)(restCode.slice(syntaxItem.ss, syntaxItem.se).replace('import', 'export'))[1];
var exportCode = toVariableExport(restCode.slice(syntaxItem.ss, syntaxItem.se));
var exports = (0, _esModuleLexer.parse)(exportCode)[1];
if (!exports.length) {

@@ -186,0 +197,0 @@ return;

{
"name": "vite-plugin-lazy-import",
"version": "1.0.4",
"version": "1.0.5",
"description": "Used for vite Lazy import js and style",

@@ -17,5 +17,5 @@ "scripts": {

"dependencies": {
"rollup": "^4.18.0",
"@rollup/pluginutils": "^5.1.0",
"es-module-lexer": "^1.5.3"
"rollup": "4.18.0",
"@rollup/pluginutils": "5.1.0",
"es-module-lexer": "1.5.3"
},

@@ -22,0 +22,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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