-
Notifications
You must be signed in to change notification settings - Fork 362
Wrong formats and broken type definitions #836
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
Comments
Can you clarify what TypeScript definition you're talking about? This is a CLI, I can't think of how TS has any relevance to it. The ESM output format generates bundles that use import and export, which is very much ES Modules. It's not clear to me what your expectation was - if a bundler did not bundle code, it wouldn't be a bundler. Microbundle is explicitly designed to produce minified output - that is effectively the entire premise of the project. Minification can be turned off using the The CJS thing is a bug that has already been fixed - the docs were updated some time in the last two weeks, but we haven't cut a release yet with the corresponding changes. It sounds like you are looking for a Rollup configuration and do not want to bundle or minify, in which case Microbundle is simply the wrong tool for the job. |
Yeah, I see. I wonder why there is this unfilled gap between rollup and a bundler. In fact what I see is that microbundle is also only an abstraction around Rollup. And if microbundle only adds the minification I don't get the purpose 😄 |
To each their own! The purpose of abstractions like Microbundle is the same as any other abstraction: instead of copy-and-pasting nearly-identical Rollup configurations into each npm module one maintains, the abstraction allows each project to depend on a centralized configuration that can be updated over time without having to manually copy changes between projects. |
Is there a workaround for this? I tried removing Thanks. |
Thought I'd update here that I fixed the root cause of this type-only issue upstream in ezolenko/rollup-plugin-typescript2#406, which was released in rpt2 |
To but it mildly I'm extremely confused. For a zero configuration bundler there is a lot to do to make it work, while actually it's completely broken.
Typescript definitions are missing files that only include interfaces which leads to broken type definitions.
The esm format is actually not a module format but also just a bundle. I would have expected to see a low transpiled code that can be picked up by another bundler when it is imported as a library in another project.
I would also expect it not to be minified if it's a module format and that it also is not put into one file but actually preserve the module structure.
When using
"type": "module"
and"main": "./dist/index.cjs",
as described in the README all bundles are namedindex.cjs.js
,index.cjs.umd.js
and so on. So all references in the package.json are wrong.The text was updated successfully, but these errors were encountered: