j40-cejst-2/client/gatsby-config.js
Vim 704831159f
dockerize front-end and pass env vars to npm build (#614)
* Revert "dockerize front end (#558)"

This reverts commit 89c23faf7a.

* dockerize frontend
- adds score server and website docker compose
- creates docker ignore
- adds .env.* for dev, prod and local
- adds dockerfile for website
- adds env to gatsby-config
- adds hostaddress to develop / start script
- adds istructions in README for running docker
- replaces fixed URLS with ones based on env vars
- creates a score server dockerfile

* updates README to change map tiles source

* adds env DATA_SOURCE:development to deploy GHA

* capitalize readme
2021-09-07 10:35:11 -07:00

68 lines
1.6 KiB
JavaScript

require('dotenv').config({
path: `.env.${process.env.DATA_SOURCE}`,
});
module.exports = {
siteMetadata: {
title: 'Justice40',
image: '/static/favicon.ico',
},
pathPrefix: `/justice40-tool/${process.env.DESTINATION_FOLDER}`,
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',
],
};