From f92b96fdcaf4b3e08b176a3ee7fcb2f31a33c78d Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Sun, 28 May 2023 01:30:11 +0800 Subject: [PATCH] fix: fix dependency issue. #412 --- packages/resolve-fallback/package.json | 4 ++-- packages/resolve-fallback/src/index.ts | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/resolve-fallback/package.json b/packages/resolve-fallback/package.json index 194ff5d6..554ef1fd 100644 --- a/packages/resolve-fallback/package.json +++ b/packages/resolve-fallback/package.json @@ -26,10 +26,10 @@ "assert": "^2.0.0", "crypto-browserify": "^3.12.0", "https-browserify": "^1.0.0", + "os": "^0.1.2", "os-browserify": "^0.3.0", "process": "^0.11.10", "stream-browserify": "^3.0.0", - "stream-http": "^3.2.0", - "url": "^0.11.0" + "stream-http": "^3.2.0" } } diff --git a/packages/resolve-fallback/src/index.ts b/packages/resolve-fallback/src/index.ts index e98ca305..5fe204c9 100644 --- a/packages/resolve-fallback/src/index.ts +++ b/packages/resolve-fallback/src/index.ts @@ -5,12 +5,15 @@ export default function resolveFallback(conf: Configuration): Configuration { throw Error('KKT:@kkt/resolve-fallback: there is no config found'); } conf.resolve.fallback = Object.assign(conf.resolve.fallback || {}, { - crypto: require.resolve('crypto-browserify'), - stream: require.resolve('stream-browserify'), assert: require.resolve('assert'), + buffer: require.resolve('buffer'), + fs: false, + path: false, + crypto: require.resolve('crypto-browserify'), http: require.resolve('stream-http'), https: require.resolve('https-browserify'), - os: require.resolve('os-browserify'), + os: require.resolve('os-browserify/browser'), + stream: require.resolve('stream-browserify'), url: require.resolve('url'), }); conf.plugins = (conf.plugins || []).concat([