forked from gremlin/chaoskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgatsby-node.js
More file actions
57 lines (54 loc) · 1.21 KB
/
gatsby-node.js
File metadata and controls
57 lines (54 loc) · 1.21 KB
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
/**
* Implement Gatsby's Node APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/node-apis/
*/
const StylelintPlugin = require('stylelint-webpack-plugin');
// Custom Webpack configuration
exports.onCreateWebpackConfig = ({
stage,
// rules,
loaders,
// plugins,
actions,
}) => {
if (['develop'].includes(stage)) {
actions.setWebpackConfig({
module: {
rules: [
{
test: /\.js$|\.jsx$/,
exclude: /(node_modules|cache|public)/,
use: [
{
loader: 'eslint-loader',
},
],
},
],
},
plugins: [
new StylelintPlugin({
files: ['src/assets/styles/**/*.scss'],
configFile: 'stylelint.config.js',
syntax: 'scss',
emitErrors: false,
}),
],
});
}
// Get around certain 3rd party modules that define `window`
// https://next.gatsbyjs.org/docs/debugging-html-builds/#debugging-html-builds
if (stage.includes('html')) {
actions.setWebpackConfig({
module: {
rules: [
{
test: /scriptjs/,
use: loaders.null(),
},
],
},
});
}
};