Skip to content
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

fix(plugin-netlify-cms): set global window vars required for Gatsby components #20264

Merged
merged 1 commit into from
Dec 27, 2019

Conversation

erezrokah
Copy link
Contributor

Fixes #19898

Netlify CMS supports registering Gatsby components as preview templates. Some of these components (gastby-link in the issue above) use global window variables set here.

The CMS plugin bundles the CMS as a separate React app thus needs to set these manually.
I'm stubbing the ___loader since preloading is not required for the CMS previews.

Not sure this is the best approach though.

@erezrokah erezrokah requested a review from a team as a code owner December 22, 2019 15:50
Copy link
Contributor

@vladar vladar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indeed looks like a workaround but I couldn't come up with a better approach too. I guess if someone has better ideas, they could send a follow-up PR. In the meantime let's ship this!

@vladar vladar added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Dec 27, 2019
@gatsbybot gatsbybot merged commit 06386b6 into gatsbyjs:master Dec 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error in Netlify CMS: ___loader is not defined
3 participants