Since generated static sites need to run build scripts in a full-stack environment, they will consume project hours when the project editor is open and the project is actively being edited.
To prevent the live site from spending project hours when folks visit it, Glitch uses the following
package.json property to make sure the output is detected as static:
If you are importing a generated static site via git or you are working on another type of generated static site that is not a remix of the Glitch starters, then you will need to add the “glitch” property shown above to your generated static site’s
The “glitch” property is only needed for generated static sites.
When using this property, it should always be entered using the exact same parameters as shown in the code snippet above. If you change them, then the project editor will ignore it.
The Glitch generated static site starters are configured so that the site is served from the
buildfolder. In the starter projects, you won’t see this folder because it is in
.gitignore. If you are working on a generated static site that is not a remix of one of our starters, make sure that you have a folder named “build” where the generated content is being saved. Once you create the
buildfolder, you can add it to
.gitignoreto save disk space.
If you would like to learn more about
package.json, check out this npm guide.