website: set up support for path redirection (#533)

* website: remove netlify specific _redirects file
* website: add basic support for redirects.js
pull/536/head
Kyle MacDonald 5 years ago committed by GitHub
parent 09b43e5569
commit 4a5e384ee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +0,0 @@
# REDIRECTS FILE
#
# See the README file in this directory for documentation. Please do not
# modify or delete existing redirects without first verifying internally.

@ -1,5 +1,6 @@
const withHashicorp = require('@hashicorp/nextjs-scripts')
const path = require('path')
const redirects = require('./redirects.js')
// log out our primary environment variables for clarity in build logs
console.log(`HASHI_ENV: ${process.env.HASHI_ENV}`)
@ -13,6 +14,9 @@ module.exports = withHashicorp({
transpileModules: ['is-absolute-url', '@hashicorp/react-mega-nav'],
mdx: { resolveIncludes: path.join(__dirname, 'pages/partials') },
})({
async redirects() {
return await redirects
},
experimental: { modern: true },
env: {
HASHI_ENV: process.env.HASHI_ENV || 'development',

@ -0,0 +1,9 @@
module.exports = [
// define your custom redirects within this file.
// vercel's redirect documentation: https://vercel.com/docs/configuration#project/redirects
// {
// source: '/foo',
// destination: '/bar',
// permanent: false,
// },
]
Loading…
Cancel
Save