From e56518e70217f22fb7ae60ec75e207dc9a0d8497 Mon Sep 17 00:00:00 2001 From: Elliot DeNolf Date: Thu, 9 Feb 2023 14:01:09 -0500 Subject: [PATCH] fix: properly alias fs at the package level, not dev --- dev/src/payload.config.ts | 2 -- src/adapters/s3/fileStub.js | 1 + src/adapters/s3/webpack.ts | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 src/adapters/s3/fileStub.js diff --git a/dev/src/payload.config.ts b/dev/src/payload.config.ts index 9db620f..f6e792b 100644 --- a/dev/src/payload.config.ts +++ b/dev/src/payload.config.ts @@ -66,8 +66,6 @@ export default buildConfig({ alias: { ...(config.resolve.alias || {}), react: path.resolve(__dirname, '../node_modules/react'), - fs: path.resolve(__dirname, 'mocks/fileStub.js'), - util: path.resolve(__dirname, 'mocks/promisifyMock.js'), '@azure/storage-blob': path.resolve(__dirname, '../../src/adapters/azure/mock.js'), '@aws-sdk/client-s3': path.resolve(__dirname, '../../src/adapters/s3/mock.js'), '@google-cloud/storage': path.resolve(__dirname, '../../src/adapters/gcs/mock.js'), diff --git a/src/adapters/s3/fileStub.js b/src/adapters/s3/fileStub.js new file mode 100644 index 0000000..e25c9a3 --- /dev/null +++ b/src/adapters/s3/fileStub.js @@ -0,0 +1 @@ +export default 'file-stub' diff --git a/src/adapters/s3/webpack.ts b/src/adapters/s3/webpack.ts index 2717f29..ef6f36b 100644 --- a/src/adapters/s3/webpack.ts +++ b/src/adapters/s3/webpack.ts @@ -10,6 +10,7 @@ export const extendWebpackConfig = (existingWebpackConfig: WebpackConfig): Webpa ...(existingWebpackConfig.resolve?.alias ? existingWebpackConfig.resolve.alias : {}), '@aws-sdk/client-s3': path.resolve(__dirname, './mock.js'), '@aws-sdk/lib-storage': path.resolve(__dirname, './mock.js'), + fs: path.resolve(__dirname, './fileStub.js'), }, }, }