Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack: Fix for process fallback using require.resolve #17249

Merged
merged 2 commits into from Jan 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
1 change: 1 addition & 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