Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: benchmark ESM build compatibility #586

Merged
merged 1 commit into from
May 14, 2024
Merged

Conversation

kieran-ryan
Copy link
Contributor

πŸ€” What's changed?

  • Migrated the benchmark script from MJS to ESM to match b7d7667 and enable it to run
Present module not found error @kieran-ryan ➜ /workspaces/node-glob (main) $ npm run bench

glob@10.3.15 prebench
npm run prepare

glob@10.3.15 prepare
tshy

glob@10.3.15 bench
bash benchmark.sh

Making benchmark fixtures

--- pattern: '{0000,0,1111,1}/{0000,0,1111,1}/{0000,0,1111,1}/**' ---
~~ sync ~~
node fast-glob sync 0m0.091s 1600
node globby sync 0m0.118s 1600
node current globSync mjs node:internal/modules/esm/resolve:265
throw new ERR_MODULE_NOT_FOUND(
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/workspaces/node-glob/dist/mjs/index.js' imported from /workspaces/node-glob/bench-working-dir/sync.mjs
at finalizeResolution (node:internal/modules/esm/resolve:265:11)
at moduleResolve (node:internal/modules/esm/resolve:933:10)
at defaultResolve (node:internal/modules/esm/resolve:1157:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:390:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:359:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:234:38)
at ModuleWrap. (node:internal/modules/esm/module_job:87:39)
at link (node:internal/modules/esm/module_job:86:36) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///workspaces/node-glob/dist/mjs/index.js'
}

Node.js v20.12.1

real 0m0.033s
user 0m0.028s
sys 0m0.004s

🏷️ What kind of change is this?

  • πŸ› Bug fix (non-breaking change which fixes a defect)

@isaacs isaacs merged commit ea4734f into isaacs:main May 14, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants