From 513e28a1e4111c978878abd57f5cbd4779455595 Mon Sep 17 00:00:00 2001 From: Fabian Dietenberger Date: Wed, 10 Mar 2021 14:55:31 +0100 Subject: [PATCH] chore(docs): set process polyfill correctly (#30160) Only set the process polyfill when needed and without a constructor --- .../release-notes/migrating-from-v2-to-v3.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/docs/reference/release-notes/migrating-from-v2-to-v3.md b/docs/docs/reference/release-notes/migrating-from-v2-to-v3.md index 335d995631c16..6456bbfc8538e 100644 --- a/docs/docs/reference/release-notes/migrating-from-v2-to-v3.md +++ b/docs/docs/reference/release-notes/migrating-from-v2-to-v3.md @@ -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' }) + ] + }) + } } ```