Skip to content

Commit

Permalink
chore(docs): set process polyfill correctly (#30160)
Browse files Browse the repository at this point in the history
Only set the process polyfill when needed and without a constructor
  • Loading branch information
feedm3 committed Mar 10, 2021
1 parent 73859a9 commit 513e28a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions docs/docs/reference/release-notes/migrating-from-v2-to-v3.md
Expand Up @@ -469,12 +469,14 @@ If you're using any other process properties, you want to polyfill process.
2. Configure webpack to use the process polyfill.
```diff:title=gatby-node.js
exports.onCreateWebpackConfig = ({ actions }) => {
actions.setWebpackConfig({
plugins: [
new plugins.provide({ process: 'process/browser' })
]
})
exports.onCreateWebpackConfig = ({ actions, stage, plugins }) => {
if (stage === 'build-javascript' || stage === 'develop') {
actions.setWebpackConfig({
plugins: [
plugins.provide({ process: 'process/browser' })
]
})
}
}
```
Expand Down

0 comments on commit 513e28a

Please sign in to comment.