-
Notifications
You must be signed in to change notification settings - Fork 1
/
gatsby-node.ts
57 lines (53 loc) · 1.61 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin';
import path from 'path';
/**
* Customise webpack config.
*/
export const onCreateWebpackConfig = ({ stage, rules, loaders, plugins, actions }) => {
if (stage === 'develop' || stage === 'build-javascript') {
actions.setWebpackConfig({
plugins: [new CaseSensitivePathsPlugin()],
});
}
// const { sentryWebpackPlugin } = require('@sentry/webpack-plugin');
// if (process.env.NODE_ENV !== 'development' && process.env.SENTRY_AUTH_TOKEN) {
// actions.setWebpackConfig({
// plugins: [
// sentryWebpackPlugin({
// sourcemaps: {
// assets: ['./public/**'],
// ignore: [],
// deleteFilesAfterUpload: [],
// },
// // ignore: ['app-*', 'polyfill-*', 'framework-*', 'webpack-runtime-*'],
// }),
// ],
// });
// }
actions.setWebpackConfig({
module: {
rules: [
{
test: /.jsonc$/,
use: [
{
loader: `jsonc-loader`,
},
],
},
],
},
resolve: {
alias: {
'@components': path.resolve(__dirname, 'src/components'),
'@data': path.resolve(__dirname, 'src/data'),
'@assets': path.resolve(__dirname, 'src/assets'),
'@functions': path.resolve(__dirname, 'src/functions'),
'@styles': path.resolve(__dirname, 'src/styles'),
'@hooks': path.resolve(__dirname, 'src/hooks'),
'@atoms': path.resolve(__dirname, 'src/atoms'),
'@api': path.resolve(__dirname, 'src/cloud-api'),
},
},
});
};