rollup 3.22.1 → 3.23.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/node-entry.js +76 -11
- package/dist/es/shared/watch.js +2 -6
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.d.ts +9 -1
- package/dist/rollup.js +2 -2
- package/dist/shared/fsevents-importer.js +2 -2
- package/dist/shared/index.js +2 -6
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/rollup.js +76 -11
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch-proxy.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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.23.0
|
|
4
|
+
Mon, 22 May 2023 05:28:38 GMT - commit 5ea36552c447d2903050d2622f2dcae3dd2df975
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -15,7 +15,7 @@ import { createHash as createHash$1 } from 'node:crypto';
|
|
|
15
15
|
import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/promises';
|
|
16
16
|
import * as tty from 'tty';
|
|
17
17
|
|
|
18
|
-
var version$1 = "3.
|
|
18
|
+
var version$1 = "3.23.0";
|
|
19
19
|
|
|
20
20
|
const comma = ','.charCodeAt(0);
|
|
21
21
|
const semicolon = ';'.charCodeAt(0);
|
|
@@ -7149,6 +7149,13 @@ const IMPURE = {
|
|
|
7149
7149
|
getLiteralValue: getTruthyLiteralValue,
|
|
7150
7150
|
hasEffectsWhenCalled: returnTrue
|
|
7151
7151
|
};
|
|
7152
|
+
const PURE_WITH_ARRAY = {
|
|
7153
|
+
deoptimizeArgumentsOnCall: doNothing,
|
|
7154
|
+
getLiteralValue: getTruthyLiteralValue,
|
|
7155
|
+
hasEffectsWhenCalled({ args }) {
|
|
7156
|
+
return args.length > 1 && !(args[1] instanceof ArrayExpression);
|
|
7157
|
+
}
|
|
7158
|
+
};
|
|
7152
7159
|
// We use shortened variables to reduce file size here
|
|
7153
7160
|
/* OBJECT */
|
|
7154
7161
|
const O = {
|
|
@@ -7186,6 +7193,11 @@ const PC = {
|
|
|
7186
7193
|
[ValueProperties]: PURE,
|
|
7187
7194
|
prototype: O
|
|
7188
7195
|
};
|
|
7196
|
+
const PC_WITH_ARRAY = {
|
|
7197
|
+
__proto__: null,
|
|
7198
|
+
[ValueProperties]: PURE_WITH_ARRAY,
|
|
7199
|
+
prototype: O
|
|
7200
|
+
};
|
|
7189
7201
|
const ARRAY_TYPE = {
|
|
7190
7202
|
__proto__: null,
|
|
7191
7203
|
[ValueProperties]: PURE,
|
|
@@ -7256,7 +7268,7 @@ const knownGlobals = {
|
|
|
7256
7268
|
isNaN: PF,
|
|
7257
7269
|
isPrototypeOf: O,
|
|
7258
7270
|
JSON: O,
|
|
7259
|
-
Map:
|
|
7271
|
+
Map: PC_WITH_ARRAY,
|
|
7260
7272
|
Math: {
|
|
7261
7273
|
__proto__: null,
|
|
7262
7274
|
[ValueProperties]: IMPURE,
|
|
@@ -7352,7 +7364,7 @@ const knownGlobals = {
|
|
|
7352
7364
|
ReferenceError: PC,
|
|
7353
7365
|
Reflect: O,
|
|
7354
7366
|
RegExp: PC,
|
|
7355
|
-
Set:
|
|
7367
|
+
Set: PC_WITH_ARRAY,
|
|
7356
7368
|
SharedArrayBuffer: C,
|
|
7357
7369
|
String: {
|
|
7358
7370
|
__proto__: null,
|
|
@@ -7392,8 +7404,8 @@ const knownGlobals = {
|
|
|
7392
7404
|
unescape: PF,
|
|
7393
7405
|
URIError: PC,
|
|
7394
7406
|
valueOf: O,
|
|
7395
|
-
WeakMap:
|
|
7396
|
-
WeakSet:
|
|
7407
|
+
WeakMap: PC_WITH_ARRAY,
|
|
7408
|
+
WeakSet: PC_WITH_ARRAY,
|
|
7397
7409
|
// Additional globals shared by Node and Browser that are not strictly part of the language
|
|
7398
7410
|
clearInterval: C,
|
|
7399
7411
|
clearTimeout: C,
|
|
@@ -24105,10 +24117,10 @@ function reserveFileNameInBundle(fileName, { bundle }, warn) {
|
|
|
24105
24117
|
bundle[fileName] = FILE_PLACEHOLDER;
|
|
24106
24118
|
}
|
|
24107
24119
|
}
|
|
24120
|
+
const emittedFileTypes = new Set(['chunk', 'asset', 'prebuilt-chunk']);
|
|
24108
24121
|
function hasValidType(emittedFile) {
|
|
24109
24122
|
return Boolean(emittedFile &&
|
|
24110
|
-
(emittedFile.type
|
|
24111
|
-
emittedFile.type === 'chunk'));
|
|
24123
|
+
emittedFileTypes.has(emittedFile.type));
|
|
24112
24124
|
}
|
|
24113
24125
|
function hasValidName(emittedFile) {
|
|
24114
24126
|
const validatedName = emittedFile.fileName || emittedFile.name;
|
|
@@ -24146,10 +24158,13 @@ class FileEmitter {
|
|
|
24146
24158
|
this.outputFileEmitters = [];
|
|
24147
24159
|
this.emitFile = (emittedFile) => {
|
|
24148
24160
|
if (!hasValidType(emittedFile)) {
|
|
24149
|
-
return error(errorFailedValidation(`Emitted files must be of type "asset" or "chunk", received "${emittedFile && emittedFile.type}".`));
|
|
24161
|
+
return error(errorFailedValidation(`Emitted files must be of type "asset", "chunk" or "prebuilt-chunk", received "${emittedFile && emittedFile.type}".`));
|
|
24162
|
+
}
|
|
24163
|
+
if (emittedFile.type === 'prebuilt-chunk') {
|
|
24164
|
+
return this.emitPrebuiltChunk(emittedFile);
|
|
24150
24165
|
}
|
|
24151
24166
|
if (!hasValidName(emittedFile)) {
|
|
24152
|
-
return error(errorFailedValidation(`The "fileName" or "name" properties of emitted
|
|
24167
|
+
return error(errorFailedValidation(`The "fileName" or "name" properties of emitted chunks and assets must be strings that are neither absolute nor relative paths, received "${emittedFile.fileName || emittedFile.name}".`));
|
|
24153
24168
|
}
|
|
24154
24169
|
if (emittedFile.type === 'chunk') {
|
|
24155
24170
|
return this.emitChunk(emittedFile);
|
|
@@ -24169,6 +24184,9 @@ class FileEmitter {
|
|
|
24169
24184
|
if (emittedFile.type === 'chunk') {
|
|
24170
24185
|
return getChunkFileName(emittedFile, this.facadeChunkByModule);
|
|
24171
24186
|
}
|
|
24187
|
+
if (emittedFile.type === 'prebuilt-chunk') {
|
|
24188
|
+
return emittedFile.fileName;
|
|
24189
|
+
}
|
|
24172
24190
|
return getAssetFileName(emittedFile, fileReferenceId);
|
|
24173
24191
|
};
|
|
24174
24192
|
this.setAssetSource = (referenceId, requestedSource) => {
|
|
@@ -24217,6 +24235,9 @@ class FileEmitter {
|
|
|
24217
24235
|
getOrCreate(consumedAssetsByHash, sourceHash, () => []).push(consumedFile);
|
|
24218
24236
|
}
|
|
24219
24237
|
}
|
|
24238
|
+
else if (consumedFile.type === 'prebuilt-chunk') {
|
|
24239
|
+
this.output.bundle[consumedFile.fileName] = this.createPrebuiltChunk(consumedFile);
|
|
24240
|
+
}
|
|
24220
24241
|
}
|
|
24221
24242
|
for (const [sourceHash, consumedFiles] of consumedAssetsByHash) {
|
|
24222
24243
|
this.finalizeAssetsWithSameSource(consumedFiles, sourceHash, output);
|
|
@@ -24243,6 +24264,27 @@ class FileEmitter {
|
|
|
24243
24264
|
}
|
|
24244
24265
|
return referenceId;
|
|
24245
24266
|
}
|
|
24267
|
+
createPrebuiltChunk(prebuiltChunk) {
|
|
24268
|
+
return {
|
|
24269
|
+
code: prebuiltChunk.code,
|
|
24270
|
+
dynamicImports: [],
|
|
24271
|
+
exports: prebuiltChunk.exports || [],
|
|
24272
|
+
facadeModuleId: null,
|
|
24273
|
+
fileName: prebuiltChunk.fileName,
|
|
24274
|
+
implicitlyLoadedBefore: [],
|
|
24275
|
+
importedBindings: {},
|
|
24276
|
+
imports: [],
|
|
24277
|
+
isDynamicEntry: false,
|
|
24278
|
+
isEntry: false,
|
|
24279
|
+
isImplicitEntry: false,
|
|
24280
|
+
map: prebuiltChunk.map || null,
|
|
24281
|
+
moduleIds: [],
|
|
24282
|
+
modules: {},
|
|
24283
|
+
name: prebuiltChunk.fileName,
|
|
24284
|
+
referencedFiles: [],
|
|
24285
|
+
type: 'chunk'
|
|
24286
|
+
};
|
|
24287
|
+
}
|
|
24246
24288
|
emitAsset(emittedAsset) {
|
|
24247
24289
|
const source = emittedAsset.source === undefined
|
|
24248
24290
|
? undefined
|
|
@@ -24298,6 +24340,29 @@ class FileEmitter {
|
|
|
24298
24340
|
});
|
|
24299
24341
|
return this.assignReferenceId(consumedChunk, emittedChunk.id);
|
|
24300
24342
|
}
|
|
24343
|
+
emitPrebuiltChunk(emitPrebuiltChunk) {
|
|
24344
|
+
if (typeof emitPrebuiltChunk.code !== 'string') {
|
|
24345
|
+
return error(errorFailedValidation(`Emitted prebuilt chunks need to have a valid string code, received "${emitPrebuiltChunk.code}".`));
|
|
24346
|
+
}
|
|
24347
|
+
if (typeof emitPrebuiltChunk.fileName !== 'string' ||
|
|
24348
|
+
isPathFragment(emitPrebuiltChunk.fileName)) {
|
|
24349
|
+
return error(errorFailedValidation(`The "fileName" property of emitted prebuilt chunks must be strings that are neither absolute nor relative paths, received "${emitPrebuiltChunk.fileName}".`));
|
|
24350
|
+
}
|
|
24351
|
+
const consumedPrebuiltChunk = {
|
|
24352
|
+
code: emitPrebuiltChunk.code,
|
|
24353
|
+
exports: emitPrebuiltChunk.exports,
|
|
24354
|
+
fileName: emitPrebuiltChunk.fileName,
|
|
24355
|
+
map: emitPrebuiltChunk.map,
|
|
24356
|
+
referenceId: '',
|
|
24357
|
+
type: 'prebuilt-chunk'
|
|
24358
|
+
};
|
|
24359
|
+
const referenceId = this.assignReferenceId(consumedPrebuiltChunk, consumedPrebuiltChunk.fileName);
|
|
24360
|
+
if (this.output) {
|
|
24361
|
+
this.output.bundle[consumedPrebuiltChunk.fileName] =
|
|
24362
|
+
this.createPrebuiltChunk(consumedPrebuiltChunk);
|
|
24363
|
+
}
|
|
24364
|
+
return referenceId;
|
|
24365
|
+
}
|
|
24301
24366
|
finalizeAdditionalAsset(consumedFile, source, { bundle, fileNamesBySource, outputOptions }) {
|
|
24302
24367
|
let { fileName, needsCodeReference, referenceId } = consumedFile;
|
|
24303
24368
|
// Deduplicate assets if an explicit fileName is not provided
|
package/dist/es/shared/watch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.23.0
|
|
4
|
+
Mon, 22 May 2023 05:28:38 GMT - commit 5ea36552c447d2903050d2622f2dcae3dd2df975
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -2660,10 +2660,6 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
|
|
|
2660
2660
|
const {listener, rawEmitter} = handlers;
|
|
2661
2661
|
let cont = FsWatchFileInstances.get(fullPath);
|
|
2662
2662
|
|
|
2663
|
-
/* eslint-disable no-unused-vars, prefer-destructuring */
|
|
2664
|
-
new Set();
|
|
2665
|
-
new Set();
|
|
2666
|
-
|
|
2667
2663
|
const copts = cont && cont.options;
|
|
2668
2664
|
if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
|
|
2669
2665
|
fs$2.unwatchFile(fullPath);
|
package/dist/loadConfigFile.js
CHANGED
package/dist/rollup.d.ts
CHANGED
|
@@ -150,7 +150,15 @@ export interface EmittedChunk {
|
|
|
150
150
|
type: 'chunk';
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
export
|
|
153
|
+
export interface EmittedPrebuiltChunk {
|
|
154
|
+
code: string;
|
|
155
|
+
exports?: string[];
|
|
156
|
+
fileName: string;
|
|
157
|
+
map?: SourceMap;
|
|
158
|
+
type: 'prebuilt-chunk';
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export type EmittedFile = EmittedAsset | EmittedChunk | EmittedPrebuiltChunk;
|
|
154
162
|
|
|
155
163
|
export type EmitFile = (emittedFile: EmittedFile) => string;
|
|
156
164
|
|
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.23.0
|
|
4
|
+
Mon, 22 May 2023 05:28:38 GMT - commit 5ea36552c447d2903050d2622f2dcae3dd2df975
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -2656,10 +2656,6 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
|
|
|
2656
2656
|
const {listener, rawEmitter} = handlers;
|
|
2657
2657
|
let cont = FsWatchFileInstances.get(fullPath);
|
|
2658
2658
|
|
|
2659
|
-
/* eslint-disable no-unused-vars, prefer-destructuring */
|
|
2660
|
-
new Set();
|
|
2661
|
-
new Set();
|
|
2662
|
-
|
|
2663
2659
|
const copts = cont && cont.options;
|
|
2664
2660
|
if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
|
|
2665
2661
|
fs$2.unwatchFile(fullPath);
|
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.23.0
|
|
4
|
+
Mon, 22 May 2023 05:28:38 GMT - commit 5ea36552c447d2903050d2622f2dcae3dd2df975
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -30,7 +30,7 @@ function _interopNamespaceDefault(e) {
|
|
|
30
30
|
|
|
31
31
|
const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
|
|
32
32
|
|
|
33
|
-
var version$1 = "3.
|
|
33
|
+
var version$1 = "3.23.0";
|
|
34
34
|
|
|
35
35
|
function ensureArray$1(items) {
|
|
36
36
|
if (Array.isArray(items)) {
|
|
@@ -7644,6 +7644,13 @@ const IMPURE = {
|
|
|
7644
7644
|
getLiteralValue: getTruthyLiteralValue,
|
|
7645
7645
|
hasEffectsWhenCalled: returnTrue
|
|
7646
7646
|
};
|
|
7647
|
+
const PURE_WITH_ARRAY = {
|
|
7648
|
+
deoptimizeArgumentsOnCall: doNothing,
|
|
7649
|
+
getLiteralValue: getTruthyLiteralValue,
|
|
7650
|
+
hasEffectsWhenCalled({ args }) {
|
|
7651
|
+
return args.length > 1 && !(args[1] instanceof ArrayExpression);
|
|
7652
|
+
}
|
|
7653
|
+
};
|
|
7647
7654
|
// We use shortened variables to reduce file size here
|
|
7648
7655
|
/* OBJECT */
|
|
7649
7656
|
const O = {
|
|
@@ -7681,6 +7688,11 @@ const PC = {
|
|
|
7681
7688
|
[ValueProperties]: PURE,
|
|
7682
7689
|
prototype: O
|
|
7683
7690
|
};
|
|
7691
|
+
const PC_WITH_ARRAY = {
|
|
7692
|
+
__proto__: null,
|
|
7693
|
+
[ValueProperties]: PURE_WITH_ARRAY,
|
|
7694
|
+
prototype: O
|
|
7695
|
+
};
|
|
7684
7696
|
const ARRAY_TYPE = {
|
|
7685
7697
|
__proto__: null,
|
|
7686
7698
|
[ValueProperties]: PURE,
|
|
@@ -7751,7 +7763,7 @@ const knownGlobals = {
|
|
|
7751
7763
|
isNaN: PF,
|
|
7752
7764
|
isPrototypeOf: O,
|
|
7753
7765
|
JSON: O,
|
|
7754
|
-
Map:
|
|
7766
|
+
Map: PC_WITH_ARRAY,
|
|
7755
7767
|
Math: {
|
|
7756
7768
|
__proto__: null,
|
|
7757
7769
|
[ValueProperties]: IMPURE,
|
|
@@ -7847,7 +7859,7 @@ const knownGlobals = {
|
|
|
7847
7859
|
ReferenceError: PC,
|
|
7848
7860
|
Reflect: O,
|
|
7849
7861
|
RegExp: PC,
|
|
7850
|
-
Set:
|
|
7862
|
+
Set: PC_WITH_ARRAY,
|
|
7851
7863
|
SharedArrayBuffer: C,
|
|
7852
7864
|
String: {
|
|
7853
7865
|
__proto__: null,
|
|
@@ -7887,8 +7899,8 @@ const knownGlobals = {
|
|
|
7887
7899
|
unescape: PF,
|
|
7888
7900
|
URIError: PC,
|
|
7889
7901
|
valueOf: O,
|
|
7890
|
-
WeakMap:
|
|
7891
|
-
WeakSet:
|
|
7902
|
+
WeakMap: PC_WITH_ARRAY,
|
|
7903
|
+
WeakSet: PC_WITH_ARRAY,
|
|
7892
7904
|
// Additional globals shared by Node and Browser that are not strictly part of the language
|
|
7893
7905
|
clearInterval: C,
|
|
7894
7906
|
clearTimeout: C,
|
|
@@ -24600,10 +24612,10 @@ function reserveFileNameInBundle(fileName, { bundle }, warn) {
|
|
|
24600
24612
|
bundle[fileName] = FILE_PLACEHOLDER;
|
|
24601
24613
|
}
|
|
24602
24614
|
}
|
|
24615
|
+
const emittedFileTypes = new Set(['chunk', 'asset', 'prebuilt-chunk']);
|
|
24603
24616
|
function hasValidType(emittedFile) {
|
|
24604
24617
|
return Boolean(emittedFile &&
|
|
24605
|
-
(emittedFile.type
|
|
24606
|
-
emittedFile.type === 'chunk'));
|
|
24618
|
+
emittedFileTypes.has(emittedFile.type));
|
|
24607
24619
|
}
|
|
24608
24620
|
function hasValidName(emittedFile) {
|
|
24609
24621
|
const validatedName = emittedFile.fileName || emittedFile.name;
|
|
@@ -24641,10 +24653,13 @@ class FileEmitter {
|
|
|
24641
24653
|
this.outputFileEmitters = [];
|
|
24642
24654
|
this.emitFile = (emittedFile) => {
|
|
24643
24655
|
if (!hasValidType(emittedFile)) {
|
|
24644
|
-
return error(errorFailedValidation(`Emitted files must be of type "asset" or "chunk", received "${emittedFile && emittedFile.type}".`));
|
|
24656
|
+
return error(errorFailedValidation(`Emitted files must be of type "asset", "chunk" or "prebuilt-chunk", received "${emittedFile && emittedFile.type}".`));
|
|
24657
|
+
}
|
|
24658
|
+
if (emittedFile.type === 'prebuilt-chunk') {
|
|
24659
|
+
return this.emitPrebuiltChunk(emittedFile);
|
|
24645
24660
|
}
|
|
24646
24661
|
if (!hasValidName(emittedFile)) {
|
|
24647
|
-
return error(errorFailedValidation(`The "fileName" or "name" properties of emitted
|
|
24662
|
+
return error(errorFailedValidation(`The "fileName" or "name" properties of emitted chunks and assets must be strings that are neither absolute nor relative paths, received "${emittedFile.fileName || emittedFile.name}".`));
|
|
24648
24663
|
}
|
|
24649
24664
|
if (emittedFile.type === 'chunk') {
|
|
24650
24665
|
return this.emitChunk(emittedFile);
|
|
@@ -24664,6 +24679,9 @@ class FileEmitter {
|
|
|
24664
24679
|
if (emittedFile.type === 'chunk') {
|
|
24665
24680
|
return getChunkFileName(emittedFile, this.facadeChunkByModule);
|
|
24666
24681
|
}
|
|
24682
|
+
if (emittedFile.type === 'prebuilt-chunk') {
|
|
24683
|
+
return emittedFile.fileName;
|
|
24684
|
+
}
|
|
24667
24685
|
return getAssetFileName(emittedFile, fileReferenceId);
|
|
24668
24686
|
};
|
|
24669
24687
|
this.setAssetSource = (referenceId, requestedSource) => {
|
|
@@ -24712,6 +24730,9 @@ class FileEmitter {
|
|
|
24712
24730
|
getOrCreate(consumedAssetsByHash, sourceHash, () => []).push(consumedFile);
|
|
24713
24731
|
}
|
|
24714
24732
|
}
|
|
24733
|
+
else if (consumedFile.type === 'prebuilt-chunk') {
|
|
24734
|
+
this.output.bundle[consumedFile.fileName] = this.createPrebuiltChunk(consumedFile);
|
|
24735
|
+
}
|
|
24715
24736
|
}
|
|
24716
24737
|
for (const [sourceHash, consumedFiles] of consumedAssetsByHash) {
|
|
24717
24738
|
this.finalizeAssetsWithSameSource(consumedFiles, sourceHash, output);
|
|
@@ -24738,6 +24759,27 @@ class FileEmitter {
|
|
|
24738
24759
|
}
|
|
24739
24760
|
return referenceId;
|
|
24740
24761
|
}
|
|
24762
|
+
createPrebuiltChunk(prebuiltChunk) {
|
|
24763
|
+
return {
|
|
24764
|
+
code: prebuiltChunk.code,
|
|
24765
|
+
dynamicImports: [],
|
|
24766
|
+
exports: prebuiltChunk.exports || [],
|
|
24767
|
+
facadeModuleId: null,
|
|
24768
|
+
fileName: prebuiltChunk.fileName,
|
|
24769
|
+
implicitlyLoadedBefore: [],
|
|
24770
|
+
importedBindings: {},
|
|
24771
|
+
imports: [],
|
|
24772
|
+
isDynamicEntry: false,
|
|
24773
|
+
isEntry: false,
|
|
24774
|
+
isImplicitEntry: false,
|
|
24775
|
+
map: prebuiltChunk.map || null,
|
|
24776
|
+
moduleIds: [],
|
|
24777
|
+
modules: {},
|
|
24778
|
+
name: prebuiltChunk.fileName,
|
|
24779
|
+
referencedFiles: [],
|
|
24780
|
+
type: 'chunk'
|
|
24781
|
+
};
|
|
24782
|
+
}
|
|
24741
24783
|
emitAsset(emittedAsset) {
|
|
24742
24784
|
const source = emittedAsset.source === undefined
|
|
24743
24785
|
? undefined
|
|
@@ -24793,6 +24835,29 @@ class FileEmitter {
|
|
|
24793
24835
|
});
|
|
24794
24836
|
return this.assignReferenceId(consumedChunk, emittedChunk.id);
|
|
24795
24837
|
}
|
|
24838
|
+
emitPrebuiltChunk(emitPrebuiltChunk) {
|
|
24839
|
+
if (typeof emitPrebuiltChunk.code !== 'string') {
|
|
24840
|
+
return error(errorFailedValidation(`Emitted prebuilt chunks need to have a valid string code, received "${emitPrebuiltChunk.code}".`));
|
|
24841
|
+
}
|
|
24842
|
+
if (typeof emitPrebuiltChunk.fileName !== 'string' ||
|
|
24843
|
+
isPathFragment(emitPrebuiltChunk.fileName)) {
|
|
24844
|
+
return error(errorFailedValidation(`The "fileName" property of emitted prebuilt chunks must be strings that are neither absolute nor relative paths, received "${emitPrebuiltChunk.fileName}".`));
|
|
24845
|
+
}
|
|
24846
|
+
const consumedPrebuiltChunk = {
|
|
24847
|
+
code: emitPrebuiltChunk.code,
|
|
24848
|
+
exports: emitPrebuiltChunk.exports,
|
|
24849
|
+
fileName: emitPrebuiltChunk.fileName,
|
|
24850
|
+
map: emitPrebuiltChunk.map,
|
|
24851
|
+
referenceId: '',
|
|
24852
|
+
type: 'prebuilt-chunk'
|
|
24853
|
+
};
|
|
24854
|
+
const referenceId = this.assignReferenceId(consumedPrebuiltChunk, consumedPrebuiltChunk.fileName);
|
|
24855
|
+
if (this.output) {
|
|
24856
|
+
this.output.bundle[consumedPrebuiltChunk.fileName] =
|
|
24857
|
+
this.createPrebuiltChunk(consumedPrebuiltChunk);
|
|
24858
|
+
}
|
|
24859
|
+
return referenceId;
|
|
24860
|
+
}
|
|
24796
24861
|
finalizeAdditionalAsset(consumedFile, source, { bundle, fileNamesBySource, outputOptions }) {
|
|
24797
24862
|
let { fileName, needsCodeReference, referenceId } = consumedFile;
|
|
24798
24863
|
// Deduplicate assets if an explicit fileName is not provided
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED