Skip to content

Commit 513e28a

Browse files
authored
chore(docs): set process polyfill correctly (#30160)
Only set the process polyfill when needed and without a constructor
1 parent 73859a9 commit 513e28a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/docs/reference/release-notes/migrating-from-v2-to-v3.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -469,12 +469,14 @@ If you're using any other process properties, you want to polyfill process.
469469
2. Configure webpack to use the process polyfill.
470470
471471
```diff:title=gatby-node.js
472-
exports.onCreateWebpackConfig = ({ actions }) => {
473-
actions.setWebpackConfig({
474-
plugins: [
475-
new plugins.provide({ process: 'process/browser' })
476-
]
477-
})
472+
exports.onCreateWebpackConfig = ({ actions, stage, plugins }) => {
473+
if (stage === 'build-javascript' || stage === 'develop') {
474+
actions.setWebpackConfig({
475+
plugins: [
476+
plugins.provide({ process: 'process/browser' })
477+
]
478+
})
479+
}
478480
}
479481
```
480482

0 commit comments

Comments
 (0)