Skip to content

Commit

Permalink
Use mixedModules and added a test
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Barber committed Sep 15, 2023
1 parent e8f5e45 commit 9ee7f46
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@types/graceful-fs": "^4.1.5",
"@types/micromatch": "^4.0.1",
"@types/node": "^14.14.37",
"@vercel/edge-config": "^0.4.0",
"analytics-node": "^3.4.0-beta.1",
"apollo-server-express": "^2.14.2",
"argon2": "^0.27.2",
Expand Down
2 changes: 1 addition & 1 deletion src/node-file-trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ export class Job {
else
await this.emitFile(asset, 'asset', path);
}),
...[...deps].map(async dep => this.maybeEmitDep(dep, path, true)),
...[...deps].map(async dep => this.maybeEmitDep(dep, path, !isESM || this.mixedModules)),
...[...imports].map(async dep => this.maybeEmitDep(dep, path, false)),
]);
}
Expand Down
5 changes: 5 additions & 0 deletions test/integration/vercel-edge-config-esm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// this will load the CJS export and should not be treated as ESM
const ec = require('@vercel/edge-config');

// this will cause the file to be treated as ESM
export default function foo() {}

0 comments on commit 9ee7f46

Please sign in to comment.