Skip to content

Commit

Permalink
pr suggestions + another external
Browse files Browse the repository at this point in the history
  • Loading branch information
paula-stacho committed Mar 4, 2024
1 parent fda6c2c commit ab71a9d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 20 deletions.
1 change: 1 addition & 0 deletions config/webpack.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module.exports = {
"node:crypto": "commonjs2 crypto",
"node:http": "commonjs2 http",
"node:https": "commonjs2 https",
"node:zlib": "commonjs2 zlib",
electron: "commonjs2 electron" // optional dep of the OIDC plugin
},

Expand Down
22 changes: 6 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions packages/import-node-fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
"mongosh": {
"unitTestsOnly": true
},
"dependencies": {
"node-fetch": "^3.3.2"
},
"devDependencies": {
"@mongodb-js/eslint-config-mongosh": "^1.0.0",
"@mongodb-js/prettier-config-devtools": "^1.0.1",
"@mongodb-js/tsconfig-mongosh": "^1.0.0",
"depcheck": "^1.4.3",
"eslint": "^7.25.0",
"prettier": "^2.8.8",
"node-fetch": "^3.3.2"
"prettier": "^2.8.8"
}
}
1 change: 1 addition & 0 deletions packages/import-node-fetch/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare const __webpack_require__: unknown;
2 changes: 1 addition & 1 deletion packages/import-node-fetch/src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'chai';
import importNodeFetch from './';

describe('makeMultilineJSIntoSingleLine', function () {
describe('import-node-fetch', function () {
it('Fails to import node-fetch normally', async function () {
let failed = false;
try {
Expand Down
3 changes: 2 additions & 1 deletion packages/import-node-fetch/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export default async function importNodeFetch(): Promise<TNodeFetch> {
err &&
typeof err === 'object' &&
'code' in err &&
err.code === 'ERR_REQUIRE_ESM'
err.code === 'ERR_REQUIRE_ESM' &&
typeof __webpack_require__ === 'undefined'
) {
// This means that the import() above was transpiled to require()
// and that that require() called failed because it saw actual on-disk ESM.
Expand Down

0 comments on commit ab71a9d

Please sign in to comment.