-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathgatsby-node.ts
43 lines (41 loc) · 1.11 KB
/
gatsby-node.ts
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
import path from 'path'
import { GatsbyNode } from 'gatsby'
export const onCreateWebpackConfig: GatsbyNode['onCreateWebpackConfig'] = ({ stage, rules, loaders, plugins, actions }) => {
if (stage === 'build-html' || stage === 'develop-html') {
actions.setWebpackConfig({
module: {
rules: [
{
test: /crunker/g,
use: loaders.null(),
},
],
},
})
}
actions.setWebpackConfig({
module: {
rules: [
{
test: /.jsonc$/,
use: [
{
loader: `jsonc-loader`,
},
],
},
],
},
resolve: {
alias: {
'@components': path.resolve(__dirname, 'src/components'),
'@data': path.resolve(__dirname, 'src/data'),
'@atoms': path.resolve(__dirname, 'src/atoms'),
'@helpers': path.resolve(__dirname, 'src/helpers'),
'@announcement-data': path.resolve(__dirname, 'src/announcement-data'),
'@hooks': path.resolve(__dirname, 'src/hooks'),
'@assets': path.resolve(__dirname, 'src/assets'),
},
},
})
}