/
gatsby-config.js
45 lines (44 loc) · 1.04 KB
/
gatsby-config.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
38
39
40
41
42
43
44
45
module.exports = {
siteMetadata: {
title: `Gatsby MDX e2e`,
},
plugins: [
{
resolve: `gatsby-source-filesystem`,
options: {
name: `pages`,
path: `${__dirname}/src/pages/`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `pages`,
path: `${__dirname}/src/posts`,
},
},
`gatsby-plugin-test-regression1`,
{
resolve: `gatsby-plugin-mdx`,
options: {
lessBabel: false,
extensions: [`.mdx`, `.md`],
defaultLayouts: {
default: require.resolve("./src/components/layout.js"),
},
remarkPlugins: [remarkRequireFilePathPlugin],
},
},
],
}
/**
* This is a test to ensure that `gatsby-plugin-mdx` correctly pass the `file` argument to the underlying remark plugins.
* See #26914 for more info.
*/
function remarkRequireFilePathPlugin() {
return function transformer(_, file) {
if (!file.dirname) {
throw new Error("No directory name for this markdown file!")
}
}
}