You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Might make sense to think of less as a configuration object, and more as a sort of internal state just for greenwood to configure itself appropriately and to provide a single source of truth (compilation) for all tasks and configurations.
So we can hoist it all to index.js or init and setup it up like
constuserHasWorkspace=/* test for user's source directory */;constuserHasWorkspacePages=/* test for user's source directory */;constrootContext=userHasWorkspace ? /* users src/ directory */ : /* internal templates */;constpagesDir=userHasWorkspacePages ? userHasWorkspacePages : /* internal templates */;consthasTemplates=/* etc */;// figure out all context situationsconstcontexts={pagesDir: path.join(rootContext,pagesDir),scratchDir: path.join(process.cwd(),'./.greenwood/'),templatesDir: path.join(rootContext,'../templates/'),publicDir: path.join(process.cwd(),'./public'),pageTemplatePath: 'page-template.js',appTemplatePath: 'app-template.js',default: true}
Then have this "cascade" / passed down as needed. Then for #40 , we can just expose a single file in the user's root directory where they can pass in their own src/ directory and then all we would need to do is override rootContext . 👌
Type of Change
Summary
It might make sense to consolidate these two objects, to reduce the cumbersome nature of passing them around.
Details
config
intocompilation
objectpublicPath
userWorkspace
,pagesDir
in webpack configsconfig
entry
in webpack.config.develop.jsThis will help clear a path forward for the following issues:
The text was updated successfully, but these errors were encountered: