-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgatsby-node.js
31 lines (29 loc) · 906 Bytes
/
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
const path = require('path');
//www.gatsbyjs.org/docs/node-apis/#onCreateWebpackConfig
https: exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => {
actions.setWebpackConfig({
resolve: {
alias: {
'@components': path.resolve(__dirname, 'src/components'),
'@images': path.resolve(__dirname, 'src/images'),
'@pages': path.resolve(__dirname, 'src/pages'),
'@styles': path.resolve(__dirname, 'src/styles'),
'@fonts': path.resolve(__dirname, 'src/fonts'),
'@hooks': path.resolve(__dirname, 'src/hooks'),
'@views': path.resolve(__dirname, 'src/views'),
},
},
});
if (stage === 'build-html' || stage === 'develop-html') {
actions.setWebpackConfig({
module: {
rules: [
{
test: /locomotive-scroll/,
use: loaders.null(),
},
],
},
});
}
};