rollup 3.20.5 → 3.20.7
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 +26 -29
- package/dist/es/shared/watch.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.js +2 -2
- package/dist/shared/fsevents-importer.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/rollup.js +26 -29
- 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.20.
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.20.7
|
|
4
|
+
Fri, 21 Apr 2023 04:31:37 GMT - commit 2820962446b40b7dfab9bdd936be1e230d8b944c
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -16,7 +16,7 @@ import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/pr
|
|
|
16
16
|
import { EventEmitter } from 'node:events';
|
|
17
17
|
import * as tty from 'tty';
|
|
18
18
|
|
|
19
|
-
var version$1 = "3.20.
|
|
19
|
+
var version$1 = "3.20.7";
|
|
20
20
|
|
|
21
21
|
const comma = ','.charCodeAt(0);
|
|
22
22
|
const semicolon = ';'.charCodeAt(0);
|
|
@@ -6860,17 +6860,11 @@ function toBase64(value) {
|
|
|
6860
6860
|
return outString;
|
|
6861
6861
|
}
|
|
6862
6862
|
|
|
6863
|
-
const validIdentifier = /^(?!\d)[\w$]+$/;
|
|
6864
|
-
function isValidIdentifier(name) {
|
|
6865
|
-
return validIdentifier.test(name);
|
|
6866
|
-
}
|
|
6867
|
-
|
|
6868
6863
|
function getSafeName(baseName, usedNames, forbiddenNames) {
|
|
6869
|
-
|
|
6870
|
-
let safeName = safeBase;
|
|
6864
|
+
let safeName = baseName;
|
|
6871
6865
|
let count = 1;
|
|
6872
6866
|
while (usedNames.has(safeName) || RESERVED_NAMES$1.has(safeName) || forbiddenNames?.has(safeName)) {
|
|
6873
|
-
safeName = `${
|
|
6867
|
+
safeName = `${baseName}$${toBase64(count++)}`;
|
|
6874
6868
|
}
|
|
6875
6869
|
usedNames.add(safeName);
|
|
6876
6870
|
return safeName;
|
|
@@ -10348,9 +10342,9 @@ class FunctionDeclaration extends FunctionNode {
|
|
|
10348
10342
|
function getDeclarationStart(code, start) {
|
|
10349
10343
|
return findNonWhiteSpace(code, findFirstOccurrenceOutsideComment(code, 'default', start) + 7);
|
|
10350
10344
|
}
|
|
10351
|
-
function
|
|
10352
|
-
const declarationEnd = findFirstOccurrenceOutsideComment(code,
|
|
10353
|
-
code = code.slice(declarationEnd, findFirstOccurrenceOutsideComment(code,
|
|
10345
|
+
function getFunctionIdInsertPosition(code, start) {
|
|
10346
|
+
const declarationEnd = findFirstOccurrenceOutsideComment(code, 'function', start) + 'function'.length;
|
|
10347
|
+
code = code.slice(declarationEnd, findFirstOccurrenceOutsideComment(code, '(', declarationEnd));
|
|
10354
10348
|
const generatorStarPos = findFirstOccurrenceOutsideComment(code, '*');
|
|
10355
10349
|
if (generatorStarPos === -1) {
|
|
10356
10350
|
return declarationEnd;
|
|
@@ -10375,10 +10369,14 @@ class ExportDefaultDeclaration extends NodeBase {
|
|
|
10375
10369
|
const { start, end } = nodeRenderOptions;
|
|
10376
10370
|
const declarationStart = getDeclarationStart(code.original, this.start);
|
|
10377
10371
|
if (this.declaration instanceof FunctionDeclaration) {
|
|
10378
|
-
this.renderNamedDeclaration(code, declarationStart,
|
|
10372
|
+
this.renderNamedDeclaration(code, declarationStart, this.declaration.id === null
|
|
10373
|
+
? getFunctionIdInsertPosition(code.original, declarationStart)
|
|
10374
|
+
: null, options);
|
|
10379
10375
|
}
|
|
10380
10376
|
else if (this.declaration instanceof ClassDeclaration) {
|
|
10381
|
-
this.renderNamedDeclaration(code, declarationStart,
|
|
10377
|
+
this.renderNamedDeclaration(code, declarationStart, this.declaration.id === null
|
|
10378
|
+
? findFirstOccurrenceOutsideComment(code.original, 'class', start) + 'class'.length
|
|
10379
|
+
: null, options);
|
|
10382
10380
|
}
|
|
10383
10381
|
else if (this.variable.getOriginalVariable() !== this.variable) {
|
|
10384
10382
|
// Remove altogether to prevent re-declaring the same variable
|
|
@@ -10401,13 +10399,13 @@ class ExportDefaultDeclaration extends NodeBase {
|
|
|
10401
10399
|
this.declaration.render(code, options);
|
|
10402
10400
|
}
|
|
10403
10401
|
applyDeoptimizations() { }
|
|
10404
|
-
renderNamedDeclaration(code, declarationStart,
|
|
10402
|
+
renderNamedDeclaration(code, declarationStart, idInsertPosition, options) {
|
|
10405
10403
|
const { exportNamesByVariable, format, snippets: { getPropertyAccess } } = options;
|
|
10406
10404
|
const name = this.variable.getName(getPropertyAccess);
|
|
10407
10405
|
// Remove `export default`
|
|
10408
10406
|
code.remove(this.start, declarationStart);
|
|
10409
|
-
if (
|
|
10410
|
-
code.appendLeft(
|
|
10407
|
+
if (idInsertPosition !== null) {
|
|
10408
|
+
code.appendLeft(idInsertPosition, ` ${name}`);
|
|
10411
10409
|
}
|
|
10412
10410
|
if (format === 'system' &&
|
|
10413
10411
|
this.declaration instanceof ClassDeclaration &&
|
|
@@ -10535,6 +10533,7 @@ class ForOfStatement extends NodeBase {
|
|
|
10535
10533
|
applyDeoptimizations() {
|
|
10536
10534
|
this.deoptimized = true;
|
|
10537
10535
|
this.left.deoptimizePath(EMPTY_PATH);
|
|
10536
|
+
this.right.deoptimizePath(UNKNOWN_PATH);
|
|
10538
10537
|
this.context.requestTreeshakingPass();
|
|
10539
10538
|
}
|
|
10540
10539
|
}
|
|
@@ -14407,7 +14406,6 @@ function getImportBlock$1(dependencies, { _, cnst, n }, compact) {
|
|
|
14407
14406
|
return '';
|
|
14408
14407
|
}
|
|
14409
14408
|
|
|
14410
|
-
const safeExportName = (name) => isValidIdentifier(name) ? name : JSON.stringify(name);
|
|
14411
14409
|
function es(magicString, { accessedGlobals, indent: t, intro, outro, dependencies, exports, snippets }, { externalLiveBindings, freeze, namespaceToStringTag }) {
|
|
14412
14410
|
const { n } = snippets;
|
|
14413
14411
|
const importBlock = getImportBlock(dependencies, snippets);
|
|
@@ -14457,7 +14455,7 @@ function getImportBlock(dependencies, { _ }) {
|
|
|
14457
14455
|
importBlock.push(`import ${defaultImport ? `${defaultImport.local},${_}` : ''}{${_}${importedNames
|
|
14458
14456
|
.map(specifier => specifier.imported === specifier.local
|
|
14459
14457
|
? specifier.imported
|
|
14460
|
-
: `${
|
|
14458
|
+
: `${specifier.imported} as ${specifier.local}`)
|
|
14461
14459
|
.join(`,${_}`)}${_}}${_}from${_}${pathWithAssertion}`);
|
|
14462
14460
|
}
|
|
14463
14461
|
}
|
|
@@ -14485,16 +14483,14 @@ function getImportBlock(dependencies, { _ }) {
|
|
|
14485
14483
|
importBlock.push(`import${_}*${_}as ${name} from${_}${pathWithAssertion}`);
|
|
14486
14484
|
}
|
|
14487
14485
|
for (const specifier of namespaceReexports) {
|
|
14488
|
-
importBlock.push(`export${_}{${_}${name === specifier.reexported
|
|
14489
|
-
? name
|
|
14490
|
-
: `${name} as ${safeExportName(specifier.reexported)}`} };`);
|
|
14486
|
+
importBlock.push(`export${_}{${_}${name === specifier.reexported ? name : `${name} as ${specifier.reexported}`} };`);
|
|
14491
14487
|
}
|
|
14492
14488
|
}
|
|
14493
14489
|
if (namedReexports.length > 0) {
|
|
14494
14490
|
importBlock.push(`export${_}{${_}${namedReexports
|
|
14495
14491
|
.map(specifier => specifier.imported === specifier.reexported
|
|
14496
|
-
?
|
|
14497
|
-
: `${
|
|
14492
|
+
? specifier.imported
|
|
14493
|
+
: `${specifier.imported} as ${specifier.reexported}`)
|
|
14498
14494
|
.join(`,${_}`)}${_}}${_}from${_}${pathWithAssertion}`);
|
|
14499
14495
|
}
|
|
14500
14496
|
}
|
|
@@ -14510,7 +14506,7 @@ function getExportBlock(exports, { _, cnst }) {
|
|
|
14510
14506
|
}
|
|
14511
14507
|
exportDeclaration.push(specifier.exported === specifier.local
|
|
14512
14508
|
? specifier.local
|
|
14513
|
-
: `${specifier.local} as ${
|
|
14509
|
+
: `${specifier.local} as ${specifier.exported}`);
|
|
14514
14510
|
}
|
|
14515
14511
|
if (exportDeclaration.length > 0) {
|
|
14516
14512
|
exportBlock.push(`export${_}{${_}${exportDeclaration.join(`,${_}`)}${_}};`);
|
|
@@ -16968,8 +16964,8 @@ function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, con
|
|
|
16968
16964
|
: `${s}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : _}}`
|
|
16969
16965
|
];
|
|
16970
16966
|
const isValidPropertyName = reservedNamesAsProps
|
|
16971
|
-
?
|
|
16972
|
-
: (name) => !RESERVED_NAMES$1.has(name) &&
|
|
16967
|
+
? (name) => validPropertyName.test(name)
|
|
16968
|
+
: (name) => !RESERVED_NAMES$1.has(name) && validPropertyName.test(name);
|
|
16973
16969
|
return {
|
|
16974
16970
|
_,
|
|
16975
16971
|
cnst,
|
|
@@ -17003,6 +16999,7 @@ function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, con
|
|
|
17003
16999
|
};
|
|
17004
17000
|
}
|
|
17005
17001
|
const wrapIfNeeded = (code, needsParens) => needsParens ? `(${code})` : code;
|
|
17002
|
+
const validPropertyName = /^(?!\d)[\w$]+$/;
|
|
17006
17003
|
|
|
17007
17004
|
class Source {
|
|
17008
17005
|
constructor(filename, content) {
|
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.20.
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.20.7
|
|
4
|
+
Fri, 21 Apr 2023 04:31:37 GMT - commit 2820962446b40b7dfab9bdd936be1e230d8b944c
|
|
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.20.
|
|
34
|
+
var version$1 = "3.20.7";
|
|
35
35
|
|
|
36
36
|
function ensureArray$1(items) {
|
|
37
37
|
if (Array.isArray(items)) {
|
|
@@ -7358,17 +7358,11 @@ function toBase64(value) {
|
|
|
7358
7358
|
return outString;
|
|
7359
7359
|
}
|
|
7360
7360
|
|
|
7361
|
-
const validIdentifier = /^(?!\d)[\w$]+$/;
|
|
7362
|
-
function isValidIdentifier(name) {
|
|
7363
|
-
return validIdentifier.test(name);
|
|
7364
|
-
}
|
|
7365
|
-
|
|
7366
7361
|
function getSafeName(baseName, usedNames, forbiddenNames) {
|
|
7367
|
-
|
|
7368
|
-
let safeName = safeBase;
|
|
7362
|
+
let safeName = baseName;
|
|
7369
7363
|
let count = 1;
|
|
7370
7364
|
while (usedNames.has(safeName) || RESERVED_NAMES$1.has(safeName) || forbiddenNames?.has(safeName)) {
|
|
7371
|
-
safeName = `${
|
|
7365
|
+
safeName = `${baseName}$${toBase64(count++)}`;
|
|
7372
7366
|
}
|
|
7373
7367
|
usedNames.add(safeName);
|
|
7374
7368
|
return safeName;
|
|
@@ -10846,9 +10840,9 @@ class FunctionDeclaration extends FunctionNode {
|
|
|
10846
10840
|
function getDeclarationStart(code, start) {
|
|
10847
10841
|
return findNonWhiteSpace(code, findFirstOccurrenceOutsideComment(code, 'default', start) + 7);
|
|
10848
10842
|
}
|
|
10849
|
-
function
|
|
10850
|
-
const declarationEnd = findFirstOccurrenceOutsideComment(code,
|
|
10851
|
-
code = code.slice(declarationEnd, findFirstOccurrenceOutsideComment(code,
|
|
10843
|
+
function getFunctionIdInsertPosition(code, start) {
|
|
10844
|
+
const declarationEnd = findFirstOccurrenceOutsideComment(code, 'function', start) + 'function'.length;
|
|
10845
|
+
code = code.slice(declarationEnd, findFirstOccurrenceOutsideComment(code, '(', declarationEnd));
|
|
10852
10846
|
const generatorStarPos = findFirstOccurrenceOutsideComment(code, '*');
|
|
10853
10847
|
if (generatorStarPos === -1) {
|
|
10854
10848
|
return declarationEnd;
|
|
@@ -10873,10 +10867,14 @@ class ExportDefaultDeclaration extends NodeBase {
|
|
|
10873
10867
|
const { start, end } = nodeRenderOptions;
|
|
10874
10868
|
const declarationStart = getDeclarationStart(code.original, this.start);
|
|
10875
10869
|
if (this.declaration instanceof FunctionDeclaration) {
|
|
10876
|
-
this.renderNamedDeclaration(code, declarationStart,
|
|
10870
|
+
this.renderNamedDeclaration(code, declarationStart, this.declaration.id === null
|
|
10871
|
+
? getFunctionIdInsertPosition(code.original, declarationStart)
|
|
10872
|
+
: null, options);
|
|
10877
10873
|
}
|
|
10878
10874
|
else if (this.declaration instanceof ClassDeclaration) {
|
|
10879
|
-
this.renderNamedDeclaration(code, declarationStart,
|
|
10875
|
+
this.renderNamedDeclaration(code, declarationStart, this.declaration.id === null
|
|
10876
|
+
? findFirstOccurrenceOutsideComment(code.original, 'class', start) + 'class'.length
|
|
10877
|
+
: null, options);
|
|
10880
10878
|
}
|
|
10881
10879
|
else if (this.variable.getOriginalVariable() !== this.variable) {
|
|
10882
10880
|
// Remove altogether to prevent re-declaring the same variable
|
|
@@ -10899,13 +10897,13 @@ class ExportDefaultDeclaration extends NodeBase {
|
|
|
10899
10897
|
this.declaration.render(code, options);
|
|
10900
10898
|
}
|
|
10901
10899
|
applyDeoptimizations() { }
|
|
10902
|
-
renderNamedDeclaration(code, declarationStart,
|
|
10900
|
+
renderNamedDeclaration(code, declarationStart, idInsertPosition, options) {
|
|
10903
10901
|
const { exportNamesByVariable, format, snippets: { getPropertyAccess } } = options;
|
|
10904
10902
|
const name = this.variable.getName(getPropertyAccess);
|
|
10905
10903
|
// Remove `export default`
|
|
10906
10904
|
code.remove(this.start, declarationStart);
|
|
10907
|
-
if (
|
|
10908
|
-
code.appendLeft(
|
|
10905
|
+
if (idInsertPosition !== null) {
|
|
10906
|
+
code.appendLeft(idInsertPosition, ` ${name}`);
|
|
10909
10907
|
}
|
|
10910
10908
|
if (format === 'system' &&
|
|
10911
10909
|
this.declaration instanceof ClassDeclaration &&
|
|
@@ -11033,6 +11031,7 @@ class ForOfStatement extends NodeBase {
|
|
|
11033
11031
|
applyDeoptimizations() {
|
|
11034
11032
|
this.deoptimized = true;
|
|
11035
11033
|
this.left.deoptimizePath(EMPTY_PATH);
|
|
11034
|
+
this.right.deoptimizePath(UNKNOWN_PATH);
|
|
11036
11035
|
this.context.requestTreeshakingPass();
|
|
11037
11036
|
}
|
|
11038
11037
|
}
|
|
@@ -14905,7 +14904,6 @@ function getImportBlock$1(dependencies, { _, cnst, n }, compact) {
|
|
|
14905
14904
|
return '';
|
|
14906
14905
|
}
|
|
14907
14906
|
|
|
14908
|
-
const safeExportName = (name) => isValidIdentifier(name) ? name : JSON.stringify(name);
|
|
14909
14907
|
function es(magicString, { accessedGlobals, indent: t, intro, outro, dependencies, exports, snippets }, { externalLiveBindings, freeze, namespaceToStringTag }) {
|
|
14910
14908
|
const { n } = snippets;
|
|
14911
14909
|
const importBlock = getImportBlock(dependencies, snippets);
|
|
@@ -14955,7 +14953,7 @@ function getImportBlock(dependencies, { _ }) {
|
|
|
14955
14953
|
importBlock.push(`import ${defaultImport ? `${defaultImport.local},${_}` : ''}{${_}${importedNames
|
|
14956
14954
|
.map(specifier => specifier.imported === specifier.local
|
|
14957
14955
|
? specifier.imported
|
|
14958
|
-
: `${
|
|
14956
|
+
: `${specifier.imported} as ${specifier.local}`)
|
|
14959
14957
|
.join(`,${_}`)}${_}}${_}from${_}${pathWithAssertion}`);
|
|
14960
14958
|
}
|
|
14961
14959
|
}
|
|
@@ -14983,16 +14981,14 @@ function getImportBlock(dependencies, { _ }) {
|
|
|
14983
14981
|
importBlock.push(`import${_}*${_}as ${name} from${_}${pathWithAssertion}`);
|
|
14984
14982
|
}
|
|
14985
14983
|
for (const specifier of namespaceReexports) {
|
|
14986
|
-
importBlock.push(`export${_}{${_}${name === specifier.reexported
|
|
14987
|
-
? name
|
|
14988
|
-
: `${name} as ${safeExportName(specifier.reexported)}`} };`);
|
|
14984
|
+
importBlock.push(`export${_}{${_}${name === specifier.reexported ? name : `${name} as ${specifier.reexported}`} };`);
|
|
14989
14985
|
}
|
|
14990
14986
|
}
|
|
14991
14987
|
if (namedReexports.length > 0) {
|
|
14992
14988
|
importBlock.push(`export${_}{${_}${namedReexports
|
|
14993
14989
|
.map(specifier => specifier.imported === specifier.reexported
|
|
14994
|
-
?
|
|
14995
|
-
: `${
|
|
14990
|
+
? specifier.imported
|
|
14991
|
+
: `${specifier.imported} as ${specifier.reexported}`)
|
|
14996
14992
|
.join(`,${_}`)}${_}}${_}from${_}${pathWithAssertion}`);
|
|
14997
14993
|
}
|
|
14998
14994
|
}
|
|
@@ -15008,7 +15004,7 @@ function getExportBlock(exports, { _, cnst }) {
|
|
|
15008
15004
|
}
|
|
15009
15005
|
exportDeclaration.push(specifier.exported === specifier.local
|
|
15010
15006
|
? specifier.local
|
|
15011
|
-
: `${specifier.local} as ${
|
|
15007
|
+
: `${specifier.local} as ${specifier.exported}`);
|
|
15012
15008
|
}
|
|
15013
15009
|
if (exportDeclaration.length > 0) {
|
|
15014
15010
|
exportBlock.push(`export${_}{${_}${exportDeclaration.join(`,${_}`)}${_}};`);
|
|
@@ -17466,8 +17462,8 @@ function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, con
|
|
|
17466
17462
|
: `${s}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : _}}`
|
|
17467
17463
|
];
|
|
17468
17464
|
const isValidPropertyName = reservedNamesAsProps
|
|
17469
|
-
?
|
|
17470
|
-
: (name) => !RESERVED_NAMES$1.has(name) &&
|
|
17465
|
+
? (name) => validPropertyName.test(name)
|
|
17466
|
+
: (name) => !RESERVED_NAMES$1.has(name) && validPropertyName.test(name);
|
|
17471
17467
|
return {
|
|
17472
17468
|
_,
|
|
17473
17469
|
cnst,
|
|
@@ -17501,6 +17497,7 @@ function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, con
|
|
|
17501
17497
|
};
|
|
17502
17498
|
}
|
|
17503
17499
|
const wrapIfNeeded = (code, needsParens) => needsParens ? `(${code})` : code;
|
|
17500
|
+
const validPropertyName = /^(?!\d)[\w$]+$/;
|
|
17504
17501
|
|
|
17505
17502
|
class Source {
|
|
17506
17503
|
constructor(filename, content) {
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED