j40-cejst-2/client/gatsby-config.js
Vim 72d80a5803
Attempt to merge Lighthouse Fix branch from Nat (#758)
* Add a11y tests in cypress for methodology page

- update cypress to version 8.5
- add HTML lang the <head> element
- change process list headings to h4
- add alt tag to download image icon
- move <GovBanner> into <Header>
- add documentation around a11y testing

* Add cypress a11y tests for cejst page

- add alt icon for mapIntro page
- change legend to be a normal div
- add a class that mimics the h4 styles
- remove superfluous styles

* Add cypress a11y tests for contact and 404 page

* Update snapshots

* Move static text in footer to copy folder

* Add cypress a11y test to About page

- add required h1 tag
- updates snapshot

* Add site_url.xml and modify robots.txt file

- adds plugins for robots.txt and sitemap
- remove env.local and will add env.production
- modifiy all yml files (docker and GHA) to specify new env variables
- refactor env variables to either DATA_SOURCE, SITE_URL or PATH_PREFIX
- set defaults for env variables in gatsby-config
- remove timeline component
- will add blank index page
- update README on info on env variables

* Add plugin to allow custom env vars

- allows system env vars, ie, DATA_SOURCE on client-side application

* Update displayed URLs in GHA to new CDN (d29)

- also updates the blank index.html

* Correct spacing

* Set SITE_URL to new CDN for robots.txt

* Remove SITE_URL as this is set by GHA

* Update README around docker and env vars
2021-10-04 08:43:33 -07:00

100 lines
2.4 KiB
JavaScript

require('dotenv').config({
// NODE_ENV is automatically set to
// 'development' when the app is launched via 'npm start' or 'npm develop'
// 'production' when the app is launched via 'npm build'
// Depending on the node environment, the app will then use
// .env.production or .env.development for application
// env variables.
path: `.env.${process.env.NODE_ENV}`,
});
module.exports = {
siteMetadata: {
title: 'Justice40',
image: '/static/favicon.ico',
siteUrl: process.env.SITE_URL || 'http://localhost:8000',
},
pathPrefix: process.env.PATH_PREFIX || '',
plugins: [
{
resolve: 'gatsby-plugin-sass',
options: {
sassOptions: {
includePaths: [
'./node_modules/uswds',
],
},
cssLoaderOptions: {
modules: {
exportLocalsConvention: 'camelCaseOnly',
},
},
},
},
{
resolve: 'gatsby-plugin-intl',
options: {
// language JSON resource path
path: `${__dirname}/src/intl`,
// supported language
languages: [`en`, `es`],
// language file path
defaultLanguage: `en`,
// option to redirect to `/en` when connecting `/`
redirect: true,
},
},
{
resolve: 'gatsby-plugin-prettier-eslint',
options: {
prettier: {
patterns: [
// The pattern "**/*.{js,jsx,ts,tsx}" is
// not used because we will rely on `eslint --fix`
'**/*.{scss}',
'**/*.{json}',
'**/*.{graphql}',
'**/*.{md}',
'**/*.{html}',
'**/*.{yaml,yml}',
],
},
eslint: {
patterns: '**/*.{js,jsx,ts,tsx}',
ignorePatterns: ['public', 'node_modules', '*scss.d.ts'],
failOnError: true,
customOptions: {
fix: true,
cache: true,
},
},
},
},
'gatsby-plugin-react-helmet',
{
resolve: 'gatsby-plugin-robots-txt',
options: {
policy: [{userAgent: '*', allow: '/'}],
},
},
{
resolve: `gatsby-plugin-sitemap`,
options: {
excludes: [
'/',
'/cejst',
'/contact',
'/methodology',
'/404',
],
},
},
{
resolve: `gatsby-plugin-env-variables`,
options: {
allowList: ['DATA_SOURCE'],
},
},
],
};