File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
packages/common/src/sandbox Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 11import memoize from 'lodash/memoize' ;
22import { Module , Directory , Sandbox } from '../types' ;
33import getTemplateDefinition from '../templates' ;
4+ import parse from '../templates/configuration/parse' ;
45
56const compareTitle = (
67 original : string ,
@@ -253,15 +254,23 @@ export const findMainModule = (sandbox?: Sandbox) => {
253254 const resolve = resolveModuleWrapped ( sandbox ) ;
254255
255256 // first attempt: try loading the entry file if it exists
256-
257257 const entryModule = resolve ( sandbox . entry ) ;
258258 if ( entryModule ) return entryModule ;
259259
260260 // second attempt: try loading the first file that exists from
261261 // the list of possible defaults in the template defination
262262 const templateDefinition = getTemplateDefinition ( sandbox . template ) ;
263263
264- const defaultOpenedFiles = templateDefinition . getDefaultOpenedFiles ( { } ) ;
264+ const parsedConfigs = parse (
265+ sandbox . template ,
266+ templateDefinition . configurationFiles ,
267+ resolve ,
268+ sandbox
269+ ) ;
270+
271+ const defaultOpenedFiles = templateDefinition . getDefaultOpenedFiles (
272+ parsedConfigs
273+ ) ;
265274
266275 const defaultOpenModule = defaultOpenedFiles
267276 . map ( path => resolve ( path ) )
You can’t perform that action at this time.
0 commit comments