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
Currently Greenwood is only aware of templates and pages in its own project. Not very helpful, obviously. The project should auto detect basic directories for the user and use the source files in those directories instead.
There's a major problem with doing this that we need to tackle.
An app(or page)-template.js could(probably will) include additional components, such as a header, footer, sidebar, who knows. When they import those components, lets say we force them to use a standard folder, for example src/components okay all the components go in there. Fine.
But... when we build, it needs to copy those files over to the scratchDirectory. This is where the problem begins.
so the app-template.js if it wants to include the components, it needs to:
import '../component/index.js`
No problem right?
Well, the problem is when this app-template turns into a app.js file within the .greenwood scratch directory, no components folder exists and if we create it, it still won't be the correct path for the relative import above.
import './components/index.js`
works, but that's so anti-practise.
edit: actually came up with a small solution. the app.js file must be placed in any directory so that the relative import paths (whatever they are) at least are correct. So I'm putting the app.js into a .greenwood/app/app.js directory and modifying webpack entry point. I'll also put the list.js (which is also broken by this path change) in that app directory as well by default.
Type of Change
Summary
Currently Greenwood is only aware of templates and pages in its own project. Not very helpful, obviously. The project should auto detect basic directories for the user and use the source files in those directories instead.
Details
Currently Greenwood knows of these directories
What it should do instead
pagesDir
- src/pages/templatesDir
- src/templatesThe text was updated successfully, but these errors were encountered: