-
Notifications
You must be signed in to change notification settings - Fork 1
/
gatsby-node.js
35 lines (31 loc) · 1.09 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
/**
* Implement Gatsby's Node APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/node-apis/
*/
const path = require('path');
const node = require('./config/node');
// webpack config
exports.onCreateWebpackConfig = ({ actions }) => {
actions.setWebpackConfig({
resolve: {
alias: {
// https://github.com/gaearon/react-hot-loader/issues/1227
// React-Hot-Loader: react-🔥-dom patch is not detected. React 16.6+ features may not work.
'react-dom': '@hot-loader/react-dom',
'~common': path.resolve(__dirname, 'src/common'),
'~layout': path.resolve(__dirname, 'src/layout'),
'~comps': path.resolve(__dirname, 'src/components'),
'~post': path.resolve(__dirname, 'src/post'),
'~hooks': path.resolve(__dirname, 'src/hooks'),
'~utils': path.resolve(__dirname, 'src/utils'),
'@': path.resolve(__dirname, 'src'),
},
},
});
};
// https://github.com/gatsbyjs/gatsby-starter-blog
// create static pages
exports.createPages = node.createPages;
// create node and fields
exports.onCreateNode = node.onCreateNode;