-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gatsby): Compile Gatsby Config Files AOT #34776
Conversation
Co-authored-by: LekoArts <lekoarts@gmail.com>
Co-authored-by: Lennart <lekoarts@gmail.com>
Co-authored-by: LekoArts <lekoarts@gmail.com>
Co-authored-by: LekoArts <lekoarts@gmail.com>
const gatsbyConfigRootDir = isCompileGatsbyFilesFlagSet() | ||
? `${program.directory}/${COMPILED_CACHE_DIR}` | ||
: program.directory | ||
const pathToGatsbyConfig = systemPath.join( | ||
program.directory, | ||
gatsbyConfigRootDir, | ||
`gatsby-config.js` | ||
) | ||
watchConfig(pathToGatsbyConfig, createGatsbyConfigNode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is compiled gatsby-config ever updated? In develop .ts file might not get siteMetadata
hot updates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pieh At the moment it's only compiled once at the start of the server, not updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now I think this can be known limitation, but we should think how we would like to address it - do we keep parcel watcher? do we watch config file (we already do above) and instead watch source file and if source is ts file we trigger on-demand compilation for it, etc?
…-gatsby (#34890) Co-authored-by: Lennart <lekoarts@gmail.com>
…rkaround EBUSY problems on Windows
Co-authored-by: Lennart <lekoarts@gmail.com>
Description
Running canary of this PR:
gatsby@alpha-ts-aot
.This introduces a new functionality laid out in #34613
TODOS
defaultConfig
path to be absolute path, not just nameContext
Not in this PR but was needed to make some refactors: