Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Not generating correct names for different output formats

Open
#825 6 comments 5 reactions 0 assignees View on GitHub

@rschristian is already working on this.

Since Sep 15, 2021.

  • #896 by @rschristian — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
build-system

Research direction

Start with the package.json fields and the src/index.ts entry point, then reproduce the build using the reported main, exports, module, unpkg, and types names. Compare the generated files in dist with the configured names and inspect the linked pull request for the current direction. Done means each output format uses its configured filename.

Written by the indexing model from the issue text.

Description

I'm trying out Microbundle with https://github.com/reduxjs/redux-toolkit . For some reason, Microbundle seems to be ignoring the names that I've specified in the various main/module/exports fields, and is trying to reuse the the name from main for all output files.

Here's what I'm seeing. Currently, I've got package.json configured with these file names:

  "source": "src/index.ts",
  "main": "dist/a.js",   
  "exports": "./dist/b.modern.js",
  "module": "dist/c.module.js", 
  "unpkg": "dist/d.umd.js",   
  "types": "dist/typings.d.ts",

Microbundle reports this output:

Build "toolkit" to dist:
      7.22 kB: a.js.gz
      6.45 kB: a.js.br
      6.06 kB: a.modern.js.gz
      5.42 kB: a.modern.js.br
      7.14 kB: a.module.js.gz
      6.39 kB: a.module.js.br
      7.31 kB: a.umd.js.gz
      6.53 kB: a.umd.js.br

And the output files are:

dist/a.js
dist/a.modern.js
dist/a.module.js
dist/a.umd.js

Those are clearly not the file names I specified. Is there something obvious I'm missing here?

Dominant language
JavaScript
Stars
8.1k
Forks
358
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from developit/microbundle

All issues in developit/microbundle

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.