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(builder): restore resolution of .mjs files #5174

Merged
merged 1 commit into from
Jan 5, 2023

Conversation

merceyz
Copy link
Member

@merceyz merceyz commented Jan 5, 2023

What's the problem this PR addresses?

#4732 stopped resolving .mjs files by default which probably wasn't on purpose.

How did you fix it?

Added resolveExtensions with the default extensions and .mjs.

Results

The performance doesn't change but the bundle size is slightly improved

$ du -s yarn*
2736    yarn-after.js
2744    yarn-before.js

$ YARN_IGNORE_PATH=1 hyperfine -w 1 \
  --prepare 'node ./before.cjs remove dummy-pkg || true' \
  'node ./before.cjs add dummy-pkg@link:./dummy-pkg' \
  --prepare 'node ./after.cjs remove dummy-pkg || true' \
  'node ./after.cjs add dummy-pkg@link:./dummy-pkg'
Benchmark 1: node ./before.cjs add dummy-pkg@link:./dummy-pkg
  Time (mean ± σ):      1.280 s ±  0.017 s    [User: 1.724 s, System: 0.306 s]
  Range (min … max):    1.263 s …  1.316 s    10 runs

Benchmark 2: node ./after.cjs add dummy-pkg@link:./dummy-pkg
  Time (mean ± σ):      1.278 s ±  0.007 s    [User: 1.699 s, System: 0.320 s]
  Range (min … max):    1.271 s …  1.289 s    10 runs

Summary
  'node ./after.cjs add dummy-pkg@link:./dummy-pkg' ran
    1.00 ± 0.01 times faster than 'node ./before.cjs add dummy-pkg@link:./dummy-pkg'

Checklist

  • I have read the Contributing Guide.
  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@merceyz merceyz changed the title fix(builder): restore resolving of .mjs files fix(builder): restore resolution of .mjs files Jan 5, 2023
@arcanis arcanis merged commit ebf4693 into master Jan 5, 2023
@arcanis arcanis deleted the merceyz/fix/builder-mjs branch January 5, 2023 09:42
merceyz added a commit that referenced this pull request Jan 29, 2023
fix(builder): restore resolving of `.mjs` files
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.

2 participants