-
Notifications
You must be signed in to change notification settings - Fork 26
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
Import config at build time #14
Conversation
1730a55
to
aecd247
Compare
853205a
to
968c3b1
Compare
a3e233b
to
f9f5d46
Compare
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.
PTAL @matv-stripe
case 'critical': { | ||
logger.error(e.error.message); | ||
break; | ||
// https://github.com/pmmmwh/react-refresh-webpack-plugin/issues/176#issuecomment-683150213 |
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.
Fast refresh doesn't work during child compilation (which is effectively what importModule
is doing). This hack seems to fix it just fine, though. I'm going to chat with the Next.js maintainers to see if there is anything else we can do about this.
global.$RefreshReg$ = noop; | ||
global.$RefreshSig$ = () => noop; | ||
|
||
const importAtBuildTime = async (resource) => { |
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.
thoughts on adding a comment here explaining this imports a "runtime" object in memory, where the runtime one creates a build time string that eventually causes a runtime import
By importing the config at build time, we are able to run
Markdoc.validate
with the config that will be used at runtime.Closes markdoc/markdoc#129