fix: asset/source namespace should only contain "default" export#20672
fix: asset/source namespace should only contain "default" export#20672xiaoxiaojx wants to merge 8 commits into
Conversation
|
This PR is packaged and the instant preview is available (a46af0a). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@b511cd2
yarn add -D webpack@https://pkg.pr.new/webpack@b511cd2
pnpm add -D webpack@https://pkg.pr.new/webpack@b511cd2 |
0d696b9 to
f414129
Compare
🦋 Changeset detectedLatest commit: a46af0a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
I am afraid it can break some libraries, technically you can bundle library which has |
f414129 to
efb4b8c
Compare
efb4b8c to
d028963
Compare
d028963 to
0011e06
Compare
|
@alexander-akait We now follow the same approach as JSON modules: when imported via with { type: "text" } (spec |
| */ | ||
| constructor({ exportsType = /** @type {"default"} */ ("default") } = {}) { | ||
| super(); | ||
| this._exportsType = exportsType; |
There was a problem hiding this comment.
I think we should not rely on this, I mean let's avoid generation of __esModule only when output.module is true, so it will be safe and no breaking change
Types CoverageCoverage after merging fix/text-via-namespace into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
themavik
left a comment
There was a problem hiding this comment.
curl test review please ignore if duplicate
|
Never mind. |
|
@magic-akari yeah, it is not related, but source import is on our roadmap too |
Summary
Per CreateDefaultExportSyntheticModule spec (tc39/proposal-import-text, tc39/proposal-json-modules), the namespace export list is « "default" ».
What kind of change does this PR introduce?
fix
Did you add tests for your changes?
Yes
Does this PR introduce a breaking change?
No
If relevant, what needs to be documented once your changes are merged or what have you already documented?
Nothing