TypeScript starter for Gatsby. No plugins and styling. Exactly the necessary to start. Ready for Gatsby 5 🔥
MIT License
@
prefixThe best way to start with this template is using the Gatsby CLI.
npx gatsby new starter-ts https://github.com/jpedroschmitz/gatsby-starter-ts
To start the project locally, run:
pnpm start
Open http://localhost:8000
with your browser to see the result.
__helpers__
— Helpers files for testing configuration.
__mocks__
— Mocks for testing.
.github
— GitHub configuration including the CI workflow.
.husky
— Husky configuration and hooks.
src
— Application source code, including pages, components, styles.pnpm start
— Starts the application in development mode at http://localhost:8000
.pnpm build
— Compile your application and make it ready for deployment.pnpm serve
— Serve the production build of your sitepnpm clean
— Wipe out the cache (.cache
folder).pnpm type-check
— Validate code using TypeScript compiler.pnpm lint
— Runs ESLint for all files in the src
directory.pnpm format
— Runs Prettier for all files in the src
directory.pnpm test
— Run tests with Vitest.pnpm test:watch
— Run tests on watch mode.TypeScript are pre-configured with custom path mappings. To import components or files, use the @
prefix.
import { Button } from '@/components/Button';
// To import images or other files from the static folder
import avatar from '@/static/avatar.png';
This starter uses pnpm by default, but this choice is yours. If you'd like to switch to Yarn/npm, delete the pnpm-lock.yaml
file, install the dependencies with Yarn/npm, change the CI workflow, Husky Git hooks to use Yarn/npm commands, and uninstall the gatsby-plugin-pnpm
plugin (you also need to remove it from the gatsby-config
file).
This project is licensed under the MIT License - see the LICENSE.md file for more information.