Skip to content

Commit

Permalink
Merge pull request #17249 from merceyz/merceyz/fix/process-fallback
Browse files Browse the repository at this point in the history
Webpack: Fix for `process` fallback using `require.resolve`
  • Loading branch information
shilman committed Jan 16, 2022
2 parents fb4d3b2 + 1310bc3 commit 011617f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/builder-webpack5/package.json
Expand Up @@ -86,6 +86,7 @@
"glob-promise": "^3.4.0",
"html-webpack-plugin": "^5.0.0",
"path-browserify": "^1.0.1",
"process": "^0.11.10",
"stable": "^0.1.8",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^5.0.3",
Expand Down
2 changes: 1 addition & 1 deletion lib/builder-webpack5/src/preview/iframe-webpack.config.ts
Expand Up @@ -214,7 +214,7 @@ export default async (options: Options & Record<string, any>): Promise<Configura
...stringifyProcessEnvs(envs),
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
}),
new ProvidePlugin({ process: 'process/browser.js' }),
new ProvidePlugin({ process: require.resolve('process/browser.js') }),
isProd ? null : new HotModuleReplacementPlugin(),
new CaseSensitivePathsPlugin(),
quiet ? null : new ProgressPlugin({}),
Expand Down
1 change: 1 addition & 0 deletions lib/manager-webpack5/package.json
Expand Up @@ -63,6 +63,7 @@
"fs-extra": "^9.0.1",
"html-webpack-plugin": "^5.0.0",
"node-fetch": "^2.6.1",
"process": "^0.11.10",
"read-pkg-up": "^7.0.1",
"regenerator-runtime": "^0.13.7",
"resolve-from": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion lib/manager-webpack5/src/presets/manager-preset.ts
Expand Up @@ -114,7 +114,7 @@ export async function managerWebpack(
...stringifyProcessEnvs(envs),
NODE_ENV: JSON.stringify(envs.NODE_ENV),
}),
new ProvidePlugin({ process: 'process/browser.js' }),
new ProvidePlugin({ process: require.resolve('process/browser.js') }),
// isProd &&
// BundleAnalyzerPlugin &&
// new BundleAnalyzerPlugin({ analyzerMode: 'static', openAnalyzer: false }),
Expand Down
2 changes: 2 additions & 0 deletions yarn.lock
Expand Up @@ -9805,6 +9805,7 @@ __metadata:
glob-promise: ^3.4.0
html-webpack-plugin: ^5.0.0
path-browserify: ^1.0.1
process: ^0.11.10
stable: ^0.1.8
style-loader: ^2.0.0
terser-webpack-plugin: ^5.0.3
Expand Down Expand Up @@ -10576,6 +10577,7 @@ __metadata:
fs-extra: ^9.0.1
html-webpack-plugin: ^5.0.0
node-fetch: ^2.6.1
process: ^0.11.10
read-pkg-up: ^7.0.1
regenerator-runtime: ^0.13.7
resolve-from: ^5.0.0
Expand Down

0 comments on commit 011617f

Please sign in to comment.