Closed rschristian closed 3 years ago
Latest commit: 26777482553c43969de63398f2b1c9600e7ffdc4
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
What kind of change does this PR introduce?
Feature, expands the
--generateTypes
flag to also support projects with TS entry points.Did you add tests for your changes?
Modified an existing test
Summary
Closes #863
The problem with the existing
--generateTypes
behavior is that it is only relevant when used with JS entry points.emitDeclaration
is derived fromoptions.generateTypes
and is only used in the following spot:https://github.com/developit/microbundle/blob/b1a637486234a2ae784ccf0c512321e2d3efef7c/src/index.js#L510
Which means that when
useTypescript
is truthy, that option holds no power whatsoever.useTypescript
would be truthy on any project that had TS entry points:https://github.com/developit/microbundle/blob/b1a637486234a2ae784ccf0c512321e2d3efef7c/src/index.js#L387
To allow projects with TS entry points to disable types from being output, we now simply disable TS's
declaration
compiler option ifoptions.generateTypes
is set to false.Does this PR introduce a breaking change?
No