-
Notifications
You must be signed in to change notification settings - Fork 2
/
gatsby-node.js
37 lines (35 loc) · 1.16 KB
/
gatsby-node.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* Implement Gatsby's Node APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/node-apis/
*/
// You can delete this file if you're not using it
exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => {
if (stage === "build-html") {
actions.setWebpackConfig({
// Don't bundle modules that reference browser globals such as `window` and `IDBIndex` during SSR.
// See: https://github.com/gatsbyjs/gatsby/issues/17725
externals: getConfig().externals.concat(function(
_context,
request,
callback
) {
// Exclude bundling firebase* and react-firebase*
// These are instead required at runtime.
if (/^@?(react-)?firebase(.*)/.test(request)) {
console.log("Excluding bundling of: " + request)
return callback(null, "umd " + request)
}
callback()
}),
})
}
}
exports.createPages = ({ graphql, actions }) => {
const { createRedirect } = actions //actions is collection of many actions - https://www.gatsbyjs.org/docs/actions
createRedirect({
fromPath: "/discord",
toPath: "https://discord.gg/GnVhHMVXdH",
isPermanent: true,
})
}