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

refactor: migrate gatsby-config to TypeScript #503

Merged
merged 1 commit into from
May 18, 2022
Merged

refactor: migrate gatsby-config to TypeScript #503

merged 1 commit into from
May 18, 2022

Conversation

nickspaargaren
Copy link
Contributor

Gatsby now supports TypeScript for the config file. This commit updates the config to make use of the GatsbyConfig type.
https://www.gatsbyjs.com/docs/how-to/custom-configuration/typescript/#gatsby-configts

@jpedroschmitz
Copy link
Owner

Thanks a lot, @nickspaargaren! Could you also migrate the gatsby-node.js file? I think it would look something like this:

import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';

import type { GatsbyNode } from 'gatsby';

export const onCreateWebpackConfig: GatsbyNode['onCreateWebpackConfig'] = ({
  actions,
}) => {
  actions.setWebpackConfig({
    resolve: {
      plugins: [new TsconfigPathsPlugin()],
    },
  });
};

@nickspaargaren
Copy link
Contributor Author

Sure, I'll create a new PR later today because of the branch naming, good catch!

@jpedroschmitz
Copy link
Owner

Don't worry about the branch name! It's ok to add this change to this PR!

@jpedroschmitz jpedroschmitz changed the title Update Gatsby config to TypeScript refactor: migrate gatsby-config to TypeScript May 18, 2022
@jpedroschmitz jpedroschmitz merged commit 19018b2 into jpedroschmitz:main May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants