Skip to content

Commit

Permalink
[INFRA] Convert gatsby-config.js to gatsby-config.ts (#774)
Browse files Browse the repository at this point in the history
Support added in [email protected]
  • Loading branch information
csouchet authored Dec 29, 2022
1 parent c355ab7 commit f17838b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions gatsby-config.js → gatsby-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@
* limitations under the License.
*/

const colors = require('./src/theme/colors.json');
import type { GatsbyConfig } from 'gatsby';
import dotenv from 'dotenv';

import colors from './src/theme/colors.json';

// Only the variables prefixed by 'GATSBY_' can be available in browser code
require('dotenv').config({
path: `.env.${process.env.NODE_ENV}`,
});
dotenv.config({ path: `.env.${process.env.NODE_ENV}` });

const robotsPolicy = { userAgent: '*' };
type RobotsPolicy = { userAgent: string; allow?: string; disallow?: string[] };
const robotsPolicy: RobotsPolicy = { userAgent: '*' };
process.env.GATSBY_ROBOTS_ENABLED === 'true'
? (robotsPolicy.allow = '/')
: (robotsPolicy.disallow = ['/']);

module.exports = {
const config: GatsbyConfig = {
siteMetadata: {
title: 'Process Analytics',
siteUrl: 'https://process-analytics.dev',
Expand Down Expand Up @@ -100,3 +102,5 @@ module.exports = {
},
],
};

export default config;

0 comments on commit f17838b

Please sign in to comment.