作者:用最优秀的你去面对爱你的人 | 来源:互联网 | 2023-09-17 20:07
DescriptionShort version: https://github.com/tinacms/tinacms/issues/268 occurs even in the website's
Description
Short version: https://github.com/tinacms/tinacms/issues/268 occurs even in the website's production build.
The Tina sidebar is set to be
when building the prod site. Since the editing sidebar is not accessible, we should avoid running any Tina code since it's just wasted electricity.
It's worth noting that, semantically, hiding the sidebar doesn't really communicate that Tina code will be removed from the production build. Other solutions that involve conditionally running Tina but require a different configuration are welcome.
Steps to reproduce
- Create a Gatsby site and add Tina to it
- In
, set the sidebar to be hidden on production like this:
1 2 3 4 5 6 7 8 9 10
| Javascript
{
resolve: "/gatsby-plugin-tinacms",
options: {
sidebar: {
hidden: process.env.NODE_ENV === "production",
position: "fixed",
},
},
}, |
Expected result
Tina does not run on production
Actual result
The Tina sidebar is inaccessible and content can't be edited, but Tina code still impacts page performance
该提问来源于开源项目:tinacms/tinacms
Because of the improvements made in #276, I am closing this issue in favor of the more specific #298