mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-02-23 01:54:18 -08:00
1. add a path prefix to the build in order to deploy on github pages 2. more importantly, use the CDN tiles, at least for now.
111 lines
2.7 KiB
JavaScript
111 lines
2.7 KiB
JavaScript
const dotenv = require('dotenv');
|
|
|
|
// load .env first so any local settings take precedence over environmental defaults loaded next
|
|
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.
|
|
dotenv.config({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 || 'j40-cejst-2',
|
|
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: [
|
|
'/',
|
|
'/about',
|
|
'/contact',
|
|
'/methodology',
|
|
'/404',
|
|
'/downloads',
|
|
],
|
|
},
|
|
},
|
|
{
|
|
resolve: `gatsby-plugin-env-variables`,
|
|
options: {
|
|
allowList: ['DATA_SOURCE', 'MAPBOX_STYLES_READ_TOKEN'],
|
|
},
|
|
},
|
|
{
|
|
resolve: '@sentry/gatsby',
|
|
options: {
|
|
dsn: process.env.SENTRY_DSN,
|
|
sampleRate: 0.7,
|
|
},
|
|
},
|
|
],
|
|
};
|