Skip to content

Commit

Permalink
fix: fix can't resolve 'process/browser' issue. #412
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 27, 2023
1 parent da39779 commit 36f644d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/resolve-fallback/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@ export default function resolveFallback(conf: Configuration): Configuration {
assert: require.resolve('assert'),
buffer: require.resolve('buffer'),
fs: false,
path: false,
path: require.resolve('path-browserify'),
crypto: require.resolve('crypto-browserify'),
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
os: require.resolve('os-browserify/browser'),
stream: require.resolve('stream-browserify'),
url: require.resolve('url'),
});
conf.module.rules.unshift({
test: /\.m?js$/,
resolve: {
fullySpecified: false, // disable the behavior
},
});
conf.plugins = (conf.plugins || []).concat([
new webpack.ProvidePlugin({
process: 'process/browser',
Expand Down

0 comments on commit 36f644d

Please sign in to comment.