Skip to content

Commit

Permalink
added Gatsby.js v2 webpack info to README.md (dfee#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonratz authored and couds committed Sep 25, 2018
1 parent 22b618c commit f5ff689
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ resolve {
```

For Gatsby.js you can add a `modifyWebpackConfig` export to your `gatsby-node.js` file:
**For Gatsby.js v1** you can add a `modifyWebpackConfig` export to your `gatsby-node.js` file:

```
exports.modifyWebpackConfig = ({config, env}) => {
Expand All @@ -140,6 +140,28 @@ exports.modifyWebpackConfig = ({config, env}) => {
}
```

**For Gatsby.js v2** you can add a `onCreateWebpackConfig` export to your `gatsby-node.js` file:

```
const path = require('path')
exports.onCreateWebpackConfig = ({
stage,
getConfig,
rules,
loaders,
actions,
}) => {
actions.setWebpackConfig({
resolve: {
alias: {
'_variables.sass': path.resolve(__dirname, 'relative/path/from/webpack/config/to/your/_variables.sass'),
},
},
})
}
```

### Override Bulma variables in CRA _without_ eject

Sometimes, you don't want to eject your CRA (Create React App) application. But how to make custom style variables for Bulma? There is a simple and right way to solve it!
Expand Down

0 comments on commit f5ff689

Please sign in to comment.