rollup 3.7.5 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/rollup +2 -2
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/rollup.js +53 -14
- package/dist/es/shared/watch.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/rollup.js +53 -14
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +1 -1
package/dist/bin/rollup
CHANGED
package/dist/es/rollup.js
CHANGED
package/dist/es/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.8.0
|
|
4
|
+
Thu, 22 Dec 2022 05:21:04 GMT - commit d750ef25d5b31bc21237963446c0a46789b8630b
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -16,7 +16,7 @@ import { promises } from 'node:fs';
|
|
|
16
16
|
import { EventEmitter } from 'node:events';
|
|
17
17
|
import * as tty from 'tty';
|
|
18
18
|
|
|
19
|
-
var version$1 = "3.
|
|
19
|
+
var version$1 = "3.8.0";
|
|
20
20
|
|
|
21
21
|
var charToInteger = {};
|
|
22
22
|
var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
@@ -15119,12 +15119,17 @@ class Chunk {
|
|
|
15119
15119
|
const renderedExports = exportMode === 'none' ? [] : this.getChunkExportDeclarations(format);
|
|
15120
15120
|
let hasExports = renderedExports.length > 0;
|
|
15121
15121
|
let hasDefaultExport = false;
|
|
15122
|
-
for (const
|
|
15122
|
+
for (const renderedDependence of renderedDependencies) {
|
|
15123
|
+
const { reexports } = renderedDependence;
|
|
15123
15124
|
if (reexports?.length) {
|
|
15124
15125
|
hasExports = true;
|
|
15125
|
-
if (reexports.some(reexport => reexport.reexported === 'default')) {
|
|
15126
|
+
if (!hasDefaultExport && reexports.some(reexport => reexport.reexported === 'default')) {
|
|
15126
15127
|
hasDefaultExport = true;
|
|
15127
|
-
|
|
15128
|
+
}
|
|
15129
|
+
if (format === 'es') {
|
|
15130
|
+
renderedDependence.reexports = reexports.filter(
|
|
15131
|
+
// eslint-disable-next-line unicorn/prefer-array-some
|
|
15132
|
+
({ reexported }) => !renderedExports.find(({ exported }) => exported === reexported));
|
|
15128
15133
|
}
|
|
15129
15134
|
}
|
|
15130
15135
|
}
|
|
@@ -15257,8 +15262,21 @@ class Chunk {
|
|
|
15257
15262
|
const variable = this.exportsByName.get(exportName);
|
|
15258
15263
|
if (!(variable instanceof SyntheticNamedExportVariable)) {
|
|
15259
15264
|
const module = variable.module;
|
|
15260
|
-
if (module
|
|
15261
|
-
|
|
15265
|
+
if (module) {
|
|
15266
|
+
const chunk = this.chunkByModule.get(module);
|
|
15267
|
+
if (chunk !== this) {
|
|
15268
|
+
if (!chunk || format !== 'es') {
|
|
15269
|
+
continue;
|
|
15270
|
+
}
|
|
15271
|
+
const chunkDep = this.renderedDependencies.get(chunk);
|
|
15272
|
+
const { imports, reexports } = chunkDep;
|
|
15273
|
+
const importedByReexported = reexports?.find(({ reexported }) => reexported === exportName);
|
|
15274
|
+
const isImported = imports?.find(({ imported }) => imported === importedByReexported?.imported);
|
|
15275
|
+
if (!isImported) {
|
|
15276
|
+
continue;
|
|
15277
|
+
}
|
|
15278
|
+
}
|
|
15279
|
+
}
|
|
15262
15280
|
}
|
|
15263
15281
|
let expression = null;
|
|
15264
15282
|
let hoisted = false;
|
|
@@ -23071,6 +23089,7 @@ class FileEmitter {
|
|
|
23071
23089
|
this.facadeChunkByModule = null;
|
|
23072
23090
|
this.nextIdBase = 1;
|
|
23073
23091
|
this.output = null;
|
|
23092
|
+
this.outputFileEmitters = [];
|
|
23074
23093
|
this.emitFile = (emittedFile) => {
|
|
23075
23094
|
if (!hasValidType(emittedFile)) {
|
|
23076
23095
|
return error(errorFailedValidation(`Emitted files must be of type "asset" or "chunk", received "${emittedFile && emittedFile.type}".`));
|
|
@@ -23114,6 +23133,9 @@ class FileEmitter {
|
|
|
23114
23133
|
}
|
|
23115
23134
|
else {
|
|
23116
23135
|
consumedFile.source = source;
|
|
23136
|
+
for (const emitter of this.outputFileEmitters) {
|
|
23137
|
+
emitter.finalizeAsset(consumedFile, source, referenceId, emitter.output);
|
|
23138
|
+
}
|
|
23117
23139
|
}
|
|
23118
23140
|
};
|
|
23119
23141
|
this.setChunkInformation = (facadeChunkByModule) => {
|
|
@@ -23136,6 +23158,10 @@ class FileEmitter {
|
|
|
23136
23158
|
this.filesByReferenceId = baseFileEmitter
|
|
23137
23159
|
? new Map(baseFileEmitter.filesByReferenceId)
|
|
23138
23160
|
: new Map();
|
|
23161
|
+
baseFileEmitter?.addOutputFileEmitter(this);
|
|
23162
|
+
}
|
|
23163
|
+
addOutputFileEmitter(outputFileEmitter) {
|
|
23164
|
+
this.outputFileEmitters.push(outputFileEmitter);
|
|
23139
23165
|
}
|
|
23140
23166
|
assignReferenceId(file, idBase) {
|
|
23141
23167
|
let referenceId;
|
|
@@ -23144,8 +23170,12 @@ class FileEmitter {
|
|
|
23144
23170
|
.update(referenceId || idBase)
|
|
23145
23171
|
.digest('hex')
|
|
23146
23172
|
.slice(0, 8);
|
|
23147
|
-
} while (this.filesByReferenceId.has(referenceId)
|
|
23173
|
+
} while (this.filesByReferenceId.has(referenceId) ||
|
|
23174
|
+
this.outputFileEmitters.some(({ filesByReferenceId }) => filesByReferenceId.has(referenceId)));
|
|
23148
23175
|
this.filesByReferenceId.set(referenceId, file);
|
|
23176
|
+
for (const { filesByReferenceId } of this.outputFileEmitters) {
|
|
23177
|
+
filesByReferenceId.set(referenceId, file);
|
|
23178
|
+
}
|
|
23149
23179
|
return referenceId;
|
|
23150
23180
|
}
|
|
23151
23181
|
emitAsset(emittedAsset) {
|
|
@@ -23160,15 +23190,24 @@ class FileEmitter {
|
|
|
23160
23190
|
};
|
|
23161
23191
|
const referenceId = this.assignReferenceId(consumedAsset, emittedAsset.fileName || emittedAsset.name || String(this.nextIdBase++));
|
|
23162
23192
|
if (this.output) {
|
|
23163
|
-
|
|
23164
|
-
|
|
23165
|
-
|
|
23166
|
-
|
|
23167
|
-
|
|
23193
|
+
this.emitAssetWithReferenceId(consumedAsset, referenceId, this.output);
|
|
23194
|
+
}
|
|
23195
|
+
else {
|
|
23196
|
+
for (const fileEmitter of this.outputFileEmitters) {
|
|
23197
|
+
fileEmitter.emitAssetWithReferenceId(consumedAsset, referenceId, fileEmitter.output);
|
|
23168
23198
|
}
|
|
23169
23199
|
}
|
|
23170
23200
|
return referenceId;
|
|
23171
23201
|
}
|
|
23202
|
+
emitAssetWithReferenceId(consumedAsset, referenceId, output) {
|
|
23203
|
+
const { fileName, source } = consumedAsset;
|
|
23204
|
+
if (fileName) {
|
|
23205
|
+
reserveFileNameInBundle(fileName, output, this.options.onwarn);
|
|
23206
|
+
}
|
|
23207
|
+
if (source !== undefined) {
|
|
23208
|
+
this.finalizeAsset(consumedAsset, source, referenceId, output);
|
|
23209
|
+
}
|
|
23210
|
+
}
|
|
23172
23211
|
emitChunk(emittedChunk) {
|
|
23173
23212
|
if (this.graph.phase > BuildPhase.LOAD_AND_PARSE) {
|
|
23174
23213
|
return error(errorInvalidRollupPhaseForChunkEmission());
|
package/dist/es/shared/watch.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.8.0
|
|
4
|
+
Thu, 22 Dec 2022 05:21:04 GMT - commit d750ef25d5b31bc21237963446c0a46789b8630b
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -31,7 +31,7 @@ function _interopNamespaceDefault(e) {
|
|
|
31
31
|
|
|
32
32
|
const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
|
|
33
33
|
|
|
34
|
-
var version$1 = "3.
|
|
34
|
+
var version$1 = "3.8.0";
|
|
35
35
|
|
|
36
36
|
function ensureArray$1(items) {
|
|
37
37
|
if (Array.isArray(items)) {
|
|
@@ -15635,12 +15635,17 @@ class Chunk {
|
|
|
15635
15635
|
const renderedExports = exportMode === 'none' ? [] : this.getChunkExportDeclarations(format);
|
|
15636
15636
|
let hasExports = renderedExports.length > 0;
|
|
15637
15637
|
let hasDefaultExport = false;
|
|
15638
|
-
for (const
|
|
15638
|
+
for (const renderedDependence of renderedDependencies) {
|
|
15639
|
+
const { reexports } = renderedDependence;
|
|
15639
15640
|
if (reexports?.length) {
|
|
15640
15641
|
hasExports = true;
|
|
15641
|
-
if (reexports.some(reexport => reexport.reexported === 'default')) {
|
|
15642
|
+
if (!hasDefaultExport && reexports.some(reexport => reexport.reexported === 'default')) {
|
|
15642
15643
|
hasDefaultExport = true;
|
|
15643
|
-
|
|
15644
|
+
}
|
|
15645
|
+
if (format === 'es') {
|
|
15646
|
+
renderedDependence.reexports = reexports.filter(
|
|
15647
|
+
// eslint-disable-next-line unicorn/prefer-array-some
|
|
15648
|
+
({ reexported }) => !renderedExports.find(({ exported }) => exported === reexported));
|
|
15644
15649
|
}
|
|
15645
15650
|
}
|
|
15646
15651
|
}
|
|
@@ -15773,8 +15778,21 @@ class Chunk {
|
|
|
15773
15778
|
const variable = this.exportsByName.get(exportName);
|
|
15774
15779
|
if (!(variable instanceof SyntheticNamedExportVariable)) {
|
|
15775
15780
|
const module = variable.module;
|
|
15776
|
-
if (module
|
|
15777
|
-
|
|
15781
|
+
if (module) {
|
|
15782
|
+
const chunk = this.chunkByModule.get(module);
|
|
15783
|
+
if (chunk !== this) {
|
|
15784
|
+
if (!chunk || format !== 'es') {
|
|
15785
|
+
continue;
|
|
15786
|
+
}
|
|
15787
|
+
const chunkDep = this.renderedDependencies.get(chunk);
|
|
15788
|
+
const { imports, reexports } = chunkDep;
|
|
15789
|
+
const importedByReexported = reexports?.find(({ reexported }) => reexported === exportName);
|
|
15790
|
+
const isImported = imports?.find(({ imported }) => imported === importedByReexported?.imported);
|
|
15791
|
+
if (!isImported) {
|
|
15792
|
+
continue;
|
|
15793
|
+
}
|
|
15794
|
+
}
|
|
15795
|
+
}
|
|
15778
15796
|
}
|
|
15779
15797
|
let expression = null;
|
|
15780
15798
|
let hoisted = false;
|
|
@@ -23587,6 +23605,7 @@ class FileEmitter {
|
|
|
23587
23605
|
this.facadeChunkByModule = null;
|
|
23588
23606
|
this.nextIdBase = 1;
|
|
23589
23607
|
this.output = null;
|
|
23608
|
+
this.outputFileEmitters = [];
|
|
23590
23609
|
this.emitFile = (emittedFile) => {
|
|
23591
23610
|
if (!hasValidType(emittedFile)) {
|
|
23592
23611
|
return error(errorFailedValidation(`Emitted files must be of type "asset" or "chunk", received "${emittedFile && emittedFile.type}".`));
|
|
@@ -23630,6 +23649,9 @@ class FileEmitter {
|
|
|
23630
23649
|
}
|
|
23631
23650
|
else {
|
|
23632
23651
|
consumedFile.source = source;
|
|
23652
|
+
for (const emitter of this.outputFileEmitters) {
|
|
23653
|
+
emitter.finalizeAsset(consumedFile, source, referenceId, emitter.output);
|
|
23654
|
+
}
|
|
23633
23655
|
}
|
|
23634
23656
|
};
|
|
23635
23657
|
this.setChunkInformation = (facadeChunkByModule) => {
|
|
@@ -23652,6 +23674,10 @@ class FileEmitter {
|
|
|
23652
23674
|
this.filesByReferenceId = baseFileEmitter
|
|
23653
23675
|
? new Map(baseFileEmitter.filesByReferenceId)
|
|
23654
23676
|
: new Map();
|
|
23677
|
+
baseFileEmitter?.addOutputFileEmitter(this);
|
|
23678
|
+
}
|
|
23679
|
+
addOutputFileEmitter(outputFileEmitter) {
|
|
23680
|
+
this.outputFileEmitters.push(outputFileEmitter);
|
|
23655
23681
|
}
|
|
23656
23682
|
assignReferenceId(file, idBase) {
|
|
23657
23683
|
let referenceId;
|
|
@@ -23660,8 +23686,12 @@ class FileEmitter {
|
|
|
23660
23686
|
.update(referenceId || idBase)
|
|
23661
23687
|
.digest('hex')
|
|
23662
23688
|
.slice(0, 8);
|
|
23663
|
-
} while (this.filesByReferenceId.has(referenceId)
|
|
23689
|
+
} while (this.filesByReferenceId.has(referenceId) ||
|
|
23690
|
+
this.outputFileEmitters.some(({ filesByReferenceId }) => filesByReferenceId.has(referenceId)));
|
|
23664
23691
|
this.filesByReferenceId.set(referenceId, file);
|
|
23692
|
+
for (const { filesByReferenceId } of this.outputFileEmitters) {
|
|
23693
|
+
filesByReferenceId.set(referenceId, file);
|
|
23694
|
+
}
|
|
23665
23695
|
return referenceId;
|
|
23666
23696
|
}
|
|
23667
23697
|
emitAsset(emittedAsset) {
|
|
@@ -23676,15 +23706,24 @@ class FileEmitter {
|
|
|
23676
23706
|
};
|
|
23677
23707
|
const referenceId = this.assignReferenceId(consumedAsset, emittedAsset.fileName || emittedAsset.name || String(this.nextIdBase++));
|
|
23678
23708
|
if (this.output) {
|
|
23679
|
-
|
|
23680
|
-
|
|
23681
|
-
|
|
23682
|
-
|
|
23683
|
-
|
|
23709
|
+
this.emitAssetWithReferenceId(consumedAsset, referenceId, this.output);
|
|
23710
|
+
}
|
|
23711
|
+
else {
|
|
23712
|
+
for (const fileEmitter of this.outputFileEmitters) {
|
|
23713
|
+
fileEmitter.emitAssetWithReferenceId(consumedAsset, referenceId, fileEmitter.output);
|
|
23684
23714
|
}
|
|
23685
23715
|
}
|
|
23686
23716
|
return referenceId;
|
|
23687
23717
|
}
|
|
23718
|
+
emitAssetWithReferenceId(consumedAsset, referenceId, output) {
|
|
23719
|
+
const { fileName, source } = consumedAsset;
|
|
23720
|
+
if (fileName) {
|
|
23721
|
+
reserveFileNameInBundle(fileName, output, this.options.onwarn);
|
|
23722
|
+
}
|
|
23723
|
+
if (source !== undefined) {
|
|
23724
|
+
this.finalizeAsset(consumedAsset, source, referenceId, output);
|
|
23725
|
+
}
|
|
23726
|
+
}
|
|
23688
23727
|
emitChunk(emittedChunk) {
|
|
23689
23728
|
if (this.graph.phase > BuildPhase.LOAD_AND_PARSE) {
|
|
23690
23729
|
return error(errorInvalidRollupPhaseForChunkEmission());
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED