Merge pull request #5072 from mempool/mononaut/fix-frontend-index-build
Fix index.html generation for custom frontend builds
This commit is contained in:
		
						commit
						8bbc27dae5
					
				| @ -11,6 +11,7 @@ let configContent = {}; | |||||||
| let gitCommitHash = ''; | let gitCommitHash = ''; | ||||||
| let packetJsonVersion = ''; | let packetJsonVersion = ''; | ||||||
| let customConfig; | let customConfig; | ||||||
|  | let customConfigContent; | ||||||
| 
 | 
 | ||||||
| try { | try { | ||||||
|   const rawConfig = fs.readFileSync(CONFIG_FILE_NAME); |   const rawConfig = fs.readFileSync(CONFIG_FILE_NAME); | ||||||
| @ -25,11 +26,16 @@ try { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| if (configContent && configContent.CUSTOMIZATION) { | if (configContent && configContent.CUSTOMIZATION) { | ||||||
|  |   try { | ||||||
|     customConfig = readConfig(configContent.CUSTOMIZATION); |     customConfig = readConfig(configContent.CUSTOMIZATION); | ||||||
|  |     customConfigContent = JSON.parse(customConfig); | ||||||
|  |   } catch (e) { | ||||||
|  |     console.log(`failed to load customization config from ${configContent.CUSTOMIZATION}`); | ||||||
|  |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| const baseModuleName = configContent.BASE_MODULE || 'mempool'; | const baseModuleName = configContent.BASE_MODULE || 'mempool'; | ||||||
| const customBuildName = (customConfig && configContent.enterprise) ? ('.' + configContent.enterprise) : ''; | const customBuildName = (customConfigContent && customConfigContent.enterprise) ? ('.' + customConfigContent.enterprise) : ''; | ||||||
| const indexFilePath = 'src/index.' + baseModuleName + customBuildName + '.html'; | const indexFilePath = 'src/index.' + baseModuleName + customBuildName + '.html'; | ||||||
| 
 | 
 | ||||||
| try { | try { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user