From 1da3ec3df5ad43d65dfd81a598c58e9a7196e63d Mon Sep 17 00:00:00 2001 From: Arctic Ice Studio Date: Wed, 19 Dec 2018 09:40:37 +0100 Subject: [PATCH] Implement "gatsby-plugin-netlify" configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Integrated gatsby-plugin-netlify like documented in the "Hosting & Continuous Deployment"”" design concept. It allows to automatically generate a `_headers` file and a `_redirects` file at the root of the public folder to configure HTTP headers (3) and redirects (4) on Netlify. One of the main advantages is that it also enables HTTP/2 server push of critical Gatsby assets through the `Link` headers. By default, the plugin adds HTTP/2 assets to server push the critical Gatsby scripts (ones that have the `preload` attribute already) and also adds some basic security and caching headers. References: (1) https://www.npmjs.com/package/gatsby-plugin-netlify (2) https://github.com/arcticicestudio/nord-docs/issues/46 (3) https://www.netlify.com/docs/headers-and-basic-auth (4) https://www.netlify.com/docs/redirects Associated epic: GH-46 GH-89 --- gatsby-config.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index 93a9ef28..b0b5946e 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -85,11 +85,9 @@ module.exports = { options: { /* The tracking IDs for all used "Google Marketing" products. */ trackingIds: [GOOGLE_UNIVERSAL_ANALYTICS_TRACKING_ID], - /* The configuration that gets passed to the `gtag.js`'s `config` command. */ /* eslint-disable-next-line babel/camelcase */ gtagConfig: { anonymize_ip: true }, - pluginConfig: { /* * Put the `gtag.js` tracking script in the HTML `` instead of the `` as recommended by Google. @@ -97,7 +95,6 @@ module.exports = { * @see https://developers.google.com/analytics/devguides/collection/gtagjs */ head: true, - /* * Respect the 'Do Not Track' HTTP header. * @@ -106,6 +103,8 @@ module.exports = { respectDNT: true } } - } + }, + /* NOTE: The following plugins must be listed last in this array to work properly! */ + "gatsby-plugin-netlify" ] };