mini-entry
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -5,3 +5,3 @@ /* | ||
* @Last Modified by: youzhao.zhou | ||
* @Last Modified time: 2022-07-07 21:09:32 | ||
* @Last Modified time: 2022-07-07 22:06:41 | ||
* @Description 获取webpack入口 | ||
@@ -113,3 +113,5 @@ * | ||
const absolutePath = join(process.cwd(), configFile); | ||
const appPathUrl = configFile.replace(extname(configFile), "").replace(new RegExp(`(\.${config.platform})$`), ""); | ||
const appPathUrl = configFile | ||
.replace(extname(configFile), "") | ||
.replace(new RegExp(`(\.${config.platform})$`), ""); | ||
const scriptPath = join( | ||
@@ -252,3 +254,10 @@ process.cwd(), | ||
const pageJsonPath = getAbsolutePath(`${page}.json`); | ||
if (fs.existsSync(pageJsonPath)) { | ||
const pageJsonPathByPlatform = getAbsolutePath( | ||
`${page}.${config.platform}.json`, | ||
); | ||
if (fs.existsSync(pageJsonPathByPlatform)) { | ||
entryConfigPath.add(pageJsonPathByPlatform); | ||
entry[entryName].push(pageJsonPathByPlatform); | ||
} else if (fs.existsSync(pageJsonPath)) { | ||
entryConfigPath.add(pageJsonPath); | ||
@@ -255,0 +264,0 @@ entry[entryName].push(pageJsonPath); |
{ | ||
"name": "mini-entry", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "解析小程序json", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
16942
594