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

mini-entry

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mini-entry - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

55

lib/index.js

@@ -5,3 +5,3 @@ /*

* @Last Modified by: youzhao.zhou
* @Last Modified time: 2021-04-22 12:17:15
* @Last Modified time: 2021-04-22 15:01:40
* @Description 获取webpack入口

@@ -68,3 +68,6 @@ *

if (tmpConfigFiles.length === 0) {
return {};
return {
entry: {},
subPackagesDir: [],
};
}

@@ -75,3 +78,3 @@

// 解析app.json文件,获取app.json中配置的页面和组件信息
const appEntry = parseApp(appEntryFilePath);
const { entry: appEntry, subPackagesDir } = parseApp(appEntryFilePath);
// 解析app.json中获取到的所有json配置文件

@@ -89,4 +92,7 @@ const componentEntry = parseComponentInPageAndComponent(entryConfigPath);

return {
...entry,
...result,
entry: {
...entry,
...result.entry,
},
subPackagesDir: [...subPackagesDir, ...result.subPackagesDir],
};

@@ -128,3 +134,5 @@ }

const mainPages = parsePages(configData.pages);
const subPages = parseSubPages(configData.subpackages);
const { entry: subPages, subPackagesDir } = parseSubPages(
configData.subpackages || configData.subPackages,
);

@@ -144,3 +152,6 @@ const entryFileAbsolutePath = join(process.cwd(), configFile);

return pages;
return {
entry: pages,
subPackagesDir,
};
}

@@ -245,7 +256,13 @@

if (!Array.isArray(pages)) {
return {};
return {
entry: {},
subPackagesDir: [],
};
}
const subPackagesDir = [];
const subPages = pages
.map((page) => {
subPackagesDir.push(page.root);
return page.pages.map((subPage) => {

@@ -258,3 +275,7 @@ return join(page.root || "", subPage);

}, []);
return parsePages(subPages);
return {
entry: parsePages(subPages),
subPackagesDir,
};
}

@@ -374,7 +395,19 @@

const entry = getAllEntry(paths);
const { entry, subPackagesDir } = getAllEntry(paths);
return entry;
const jsonFiles = {};
Object.keys(entry).forEach((item) => {
const jsonFile = entry[item].find((element) =>
/\.(json)$/.test(String(element)),
);
if (jsonFile) {
jsonFiles[item] = jsonFile;
}
});
return { entry, jsonFiles, subPackagesDir };
}
module.exports = getEntry;

2

package.json
{
"name": "mini-entry",
"version": "0.0.10",
"version": "0.0.11",
"description": "解析小程序json",

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

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