Question: TypeScript support for gatsby-* files? #26314
-
SummaryAre there any plans to natively support TypeScript for If not (or until such a day), is there a suggested way to achieve the same effect? Right now I'm registering // gatsby-config.js
require('ts-node').register()
module.exports = require('./src/config/gatsby-config.ts') // src/config/gatsby-config.ts
import { GatsbyConfig } from 'gatsby'
const gatsbyConfig: GatsbyConfig = {
siteMetadata: {
siteName: 'My Cool Site',
},
}
export default gatsbyConfig |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
@mrseanbaines It absolutely is on the roadmap! Though it's hard to pin down when it'll be completed. In the meantime, your approach looks very reasonable! |
Beta Was this translation helpful? Give feedback.
-
Good to hear! And good to know that my approach for now looks okay. Thanks for the response 💥 |
Beta Was this translation helpful? Give feedback.
-
@blainekasten until it is implemented, maybe the workaround can be placed in docs? for example here: https://www.gatsbyjs.com/docs/typescript/ |
Beta Was this translation helpful? Give feedback.
-
@muescha that is a neat idea! But I think our time is better spent getting the code to work for it :) |
Beta Was this translation helpful? Give feedback.
@mrseanbaines It absolutely is on the roadmap! Though it's hard to pin down when it'll be completed. In the meantime, your approach looks very reasonable!