rollup 4.48.0-0 → 4.48.1
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/LICENSE.md +1 -1
- package/dist/bin/rollup +2 -2
- package/dist/es/getLogFilter.js +2 -2
- package/dist/es/parseAst.js +2 -2
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/node-entry.js +75 -28
- package/dist/es/shared/parseAst.js +3 -3
- package/dist/es/shared/watch.js +2 -2
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/parseAst.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/parseAst.js +3 -3
- package/dist/shared/rollup.js +75 -28
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +28 -28
package/LICENSE.md
CHANGED
|
@@ -395,7 +395,7 @@ Repository: git+https://gitlab.com/Rich-Harris/locate-character.git
|
|
|
395
395
|
## magic-string
|
|
396
396
|
License: MIT
|
|
397
397
|
By: Rich Harris
|
|
398
|
-
Repository: https://github.com/rich-harris/magic-string
|
|
398
|
+
Repository: https://github.com/rich-harris/magic-string.git
|
|
399
399
|
|
|
400
400
|
> Copyright 2018 Rich Harris
|
|
401
401
|
>
|
package/dist/bin/rollup
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*
|
|
3
3
|
@license
|
|
4
|
-
Rollup.js v4.48.
|
|
5
|
-
|
|
4
|
+
Rollup.js v4.48.1
|
|
5
|
+
Mon, 25 Aug 2025 05:42:43 GMT - commit 8b6b06b16c2198f1e61749f17cbdbc25f2d3d214
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
8
8
|
|
package/dist/es/getLogFilter.js
CHANGED
package/dist/es/parseAst.js
CHANGED
package/dist/es/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.48.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.48.1
|
|
4
|
+
Mon, 25 Aug 2025 05:42:43 GMT - commit 8b6b06b16c2198f1e61749f17cbdbc25f2d3d214
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -27,7 +27,7 @@ function _mergeNamespaces(n, m) {
|
|
|
27
27
|
return Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' });
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
var version = "4.48.
|
|
30
|
+
var version = "4.48.1";
|
|
31
31
|
|
|
32
32
|
// src/vlq.ts
|
|
33
33
|
var comma = ",".charCodeAt(0);
|
|
@@ -1238,12 +1238,18 @@ class MagicString {
|
|
|
1238
1238
|
if (this.byStart[index] || this.byEnd[index]) return;
|
|
1239
1239
|
|
|
1240
1240
|
let chunk = this.lastSearchedChunk;
|
|
1241
|
+
let previousChunk = chunk;
|
|
1241
1242
|
const searchForward = index > chunk.end;
|
|
1242
1243
|
|
|
1243
1244
|
while (chunk) {
|
|
1244
1245
|
if (chunk.contains(index)) return this._splitChunk(chunk, index);
|
|
1245
1246
|
|
|
1246
1247
|
chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
|
|
1248
|
+
|
|
1249
|
+
// Prevent infinite loop (e.g. via empty chunks, where start === end)
|
|
1250
|
+
if (chunk === previousChunk) return;
|
|
1251
|
+
|
|
1252
|
+
previousChunk = chunk;
|
|
1247
1253
|
}
|
|
1248
1254
|
}
|
|
1249
1255
|
|
|
@@ -5138,7 +5144,7 @@ class LocalVariable extends Variable {
|
|
|
5138
5144
|
isIdentifierNode(declaration.parent.parent.callee.property) &&
|
|
5139
5145
|
declaration.parent.parent.callee.property.name === 'then' &&
|
|
5140
5146
|
isImportExpressionNode(declaration.parent.parent.callee.object)) {
|
|
5141
|
-
declaration.parent.parent.callee.object.includePath(path);
|
|
5147
|
+
declaration.parent.parent.callee.object.includePath(path, context);
|
|
5142
5148
|
}
|
|
5143
5149
|
}
|
|
5144
5150
|
// We need to make sure we include the correct path of the init
|
|
@@ -13077,15 +13083,21 @@ class ImportExpression extends NodeBase {
|
|
|
13077
13083
|
this.resolution = null;
|
|
13078
13084
|
this.resolutionString = null;
|
|
13079
13085
|
}
|
|
13086
|
+
get shouldIncludeDynamicAttributes() {
|
|
13087
|
+
return isFlagSet(this.flags, 536870912 /* Flag.shouldIncludeDynamicAttributes */);
|
|
13088
|
+
}
|
|
13089
|
+
set shouldIncludeDynamicAttributes(value) {
|
|
13090
|
+
this.flags = setFlag(this.flags, 536870912 /* Flag.shouldIncludeDynamicAttributes */, value);
|
|
13091
|
+
}
|
|
13080
13092
|
get withinTopLevelAwait() {
|
|
13081
13093
|
return isFlagSet(this.flags, 134217728 /* Flag.withinTopLevelAwait */);
|
|
13082
13094
|
}
|
|
13083
13095
|
set withinTopLevelAwait(value) {
|
|
13084
13096
|
this.flags = setFlag(this.flags, 134217728 /* Flag.withinTopLevelAwait */, value);
|
|
13085
13097
|
}
|
|
13086
|
-
// Do not bind attributes
|
|
13087
13098
|
bind() {
|
|
13088
13099
|
this.source.bind();
|
|
13100
|
+
this.options?.bind();
|
|
13089
13101
|
}
|
|
13090
13102
|
/**
|
|
13091
13103
|
* Get imported variables for deterministic usage, valid cases are:
|
|
@@ -13168,17 +13180,21 @@ class ImportExpression extends NodeBase {
|
|
|
13168
13180
|
}
|
|
13169
13181
|
include(context, includeChildrenRecursively) {
|
|
13170
13182
|
if (!this.included)
|
|
13171
|
-
this.includeNode();
|
|
13183
|
+
this.includeNode(context);
|
|
13172
13184
|
this.source.include(context, includeChildrenRecursively);
|
|
13185
|
+
if (this.shouldIncludeDynamicAttributes)
|
|
13186
|
+
this.options?.include(context, includeChildrenRecursively);
|
|
13173
13187
|
}
|
|
13174
|
-
includeNode() {
|
|
13188
|
+
includeNode(context) {
|
|
13175
13189
|
this.included = true;
|
|
13190
|
+
if (this.shouldIncludeDynamicAttributes)
|
|
13191
|
+
this.options?.includePath(UNKNOWN_PATH, context);
|
|
13176
13192
|
this.scope.context.includeDynamicImport(this);
|
|
13177
13193
|
this.scope.addAccessedDynamicImport(this);
|
|
13178
13194
|
}
|
|
13179
|
-
includePath(path) {
|
|
13195
|
+
includePath(path, context) {
|
|
13180
13196
|
if (!this.included)
|
|
13181
|
-
this.includeNode();
|
|
13197
|
+
this.includeNode(context);
|
|
13182
13198
|
// Technically, this is not correct as dynamic imports return a Promise.
|
|
13183
13199
|
if (this.hasUnknownAccessedKey)
|
|
13184
13200
|
return;
|
|
@@ -13515,6 +13531,14 @@ class JSXAttribute extends NodeBase {
|
|
|
13515
13531
|
}
|
|
13516
13532
|
if (value) {
|
|
13517
13533
|
code.overwrite(name.end, value.start, ': ', { contentOnly: true });
|
|
13534
|
+
// foo="aa \n aa"
|
|
13535
|
+
if (value instanceof Literal &&
|
|
13536
|
+
typeof value.value === 'string' &&
|
|
13537
|
+
value.value.includes('\n')) {
|
|
13538
|
+
code.overwrite(value.start, value.end, JSON.stringify(value.value), {
|
|
13539
|
+
contentOnly: true
|
|
13540
|
+
});
|
|
13541
|
+
}
|
|
13518
13542
|
}
|
|
13519
13543
|
else {
|
|
13520
13544
|
code.appendLeft(name.end, ': true');
|
|
@@ -13576,10 +13600,35 @@ class JSXExpressionContainer extends NodeBase {
|
|
|
13576
13600
|
}
|
|
13577
13601
|
}
|
|
13578
13602
|
|
|
13603
|
+
const RE_WHITESPACE_TRIM = /^[ \t]*\r?\n[ \t\r\n]*|[ \t]*\r?\n[ \t\r\n]*$/g;
|
|
13604
|
+
const RE_WHITESPACE_MERGE = /[ \t]*\r?\n[ \t\r\n]*/g;
|
|
13605
|
+
class JSXText extends NodeBase {
|
|
13606
|
+
shouldRender() {
|
|
13607
|
+
return !!this.getRenderedText();
|
|
13608
|
+
}
|
|
13609
|
+
render(code) {
|
|
13610
|
+
const { mode } = this.scope.context.options.jsx;
|
|
13611
|
+
if (mode !== 'preserve') {
|
|
13612
|
+
code.overwrite(this.start, this.end, JSON.stringify(this.getRenderedText()), {
|
|
13613
|
+
contentOnly: true
|
|
13614
|
+
});
|
|
13615
|
+
}
|
|
13616
|
+
}
|
|
13617
|
+
getRenderedText() {
|
|
13618
|
+
if (this.renderedText === undefined)
|
|
13619
|
+
this.renderedText = this.value
|
|
13620
|
+
.replace(RE_WHITESPACE_TRIM, '')
|
|
13621
|
+
.replace(RE_WHITESPACE_MERGE, ' ');
|
|
13622
|
+
return this.renderedText;
|
|
13623
|
+
}
|
|
13624
|
+
}
|
|
13625
|
+
JSXText.prototype.includeNode = onlyIncludeSelf;
|
|
13626
|
+
|
|
13579
13627
|
function getRenderedJsxChildren(children) {
|
|
13580
13628
|
let renderedChildren = 0;
|
|
13581
13629
|
for (const child of children) {
|
|
13582
|
-
if (!(child instanceof JSXExpressionContainer && child.expression instanceof JSXEmptyExpression)
|
|
13630
|
+
if (!(child instanceof JSXExpressionContainer && child.expression instanceof JSXEmptyExpression) &&
|
|
13631
|
+
(!(child instanceof JSXText) || child.shouldRender())) {
|
|
13583
13632
|
renderedChildren++;
|
|
13584
13633
|
}
|
|
13585
13634
|
}
|
|
@@ -13657,8 +13706,9 @@ class JSXElementBase extends NodeBase {
|
|
|
13657
13706
|
let childrenEnd = openingEnd;
|
|
13658
13707
|
let firstChild = null;
|
|
13659
13708
|
for (const child of children) {
|
|
13660
|
-
if (child instanceof JSXExpressionContainer &&
|
|
13661
|
-
child.expression instanceof JSXEmptyExpression)
|
|
13709
|
+
if ((child instanceof JSXExpressionContainer &&
|
|
13710
|
+
child.expression instanceof JSXEmptyExpression) ||
|
|
13711
|
+
(child instanceof JSXText && !child.shouldRender())) {
|
|
13662
13712
|
code.remove(childrenEnd, child.end);
|
|
13663
13713
|
}
|
|
13664
13714
|
else {
|
|
@@ -13964,18 +14014,6 @@ class JSXSpreadChild extends NodeBase {
|
|
|
13964
14014
|
}
|
|
13965
14015
|
}
|
|
13966
14016
|
|
|
13967
|
-
class JSXText extends NodeBase {
|
|
13968
|
-
render(code) {
|
|
13969
|
-
const { mode } = this.scope.context.options.jsx;
|
|
13970
|
-
if (mode !== 'preserve') {
|
|
13971
|
-
code.overwrite(this.start, this.end, JSON.stringify(this.value), {
|
|
13972
|
-
contentOnly: true
|
|
13973
|
-
});
|
|
13974
|
-
}
|
|
13975
|
-
}
|
|
13976
|
-
}
|
|
13977
|
-
JSXText.prototype.includeNode = onlyIncludeSelf;
|
|
13978
|
-
|
|
13979
14017
|
class LabeledStatement extends NodeBase {
|
|
13980
14018
|
hasEffects(context) {
|
|
13981
14019
|
const { brokenFlow, includedLabels } = context;
|
|
@@ -18729,13 +18767,18 @@ class Chunk {
|
|
|
18729
18767
|
(resolution instanceof Chunk || resolution instanceof ExternalChunk));
|
|
18730
18768
|
}
|
|
18731
18769
|
getDynamicImportStringAndAttributes(resolution, fileName, node) {
|
|
18770
|
+
const { externalImportAttributes } = this.outputOptions;
|
|
18771
|
+
const keepExternalImportAttributes = ['es', 'cjs'].includes(this.outputOptions.format) && externalImportAttributes;
|
|
18732
18772
|
if (resolution instanceof ExternalModule) {
|
|
18733
18773
|
const chunk = this.externalChunkByModule.get(resolution);
|
|
18734
|
-
|
|
18774
|
+
const dynamicAttributes = chunk.getImportAttributes(this.snippets);
|
|
18775
|
+
return [
|
|
18776
|
+
`'${chunk.getImportPath(fileName)}'`,
|
|
18777
|
+
dynamicAttributes || (keepExternalImportAttributes ? true : null)
|
|
18778
|
+
];
|
|
18735
18779
|
}
|
|
18736
18780
|
let attributes = null;
|
|
18737
|
-
if (
|
|
18738
|
-
this.outputOptions.externalImportAttributes) {
|
|
18781
|
+
if (keepExternalImportAttributes) {
|
|
18739
18782
|
const attributesFromImportAttributes = getAttributesFromImportExpression(node);
|
|
18740
18783
|
attributes =
|
|
18741
18784
|
attributesFromImportAttributes === EMPTY_OBJECT
|
|
@@ -21433,7 +21476,11 @@ class ModuleLoader {
|
|
|
21433
21476
|
getResolveDynamicImportPromises(module) {
|
|
21434
21477
|
return module.dynamicImports.map(async (dynamicImport) => {
|
|
21435
21478
|
const resolvedId = await this.resolveDynamicImport(module, dynamicImport.argument, module.id, getAttributesFromImportExpression(dynamicImport.node));
|
|
21436
|
-
if (resolvedId
|
|
21479
|
+
if (!resolvedId || typeof resolvedId === 'string') {
|
|
21480
|
+
dynamicImport.node.shouldIncludeDynamicAttributes = true;
|
|
21481
|
+
}
|
|
21482
|
+
else {
|
|
21483
|
+
dynamicImport.node.shouldIncludeDynamicAttributes = !!resolvedId.external;
|
|
21437
21484
|
dynamicImport.id = resolvedId.id;
|
|
21438
21485
|
}
|
|
21439
21486
|
return [dynamicImport, resolvedId];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.48.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.48.1
|
|
4
|
+
Mon, 25 Aug 2025 05:42:43 GMT - commit 8b6b06b16c2198f1e61749f17cbdbc25f2d3d214
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -704,7 +704,7 @@ function logImportOptionsAreInvalid(importer) {
|
|
|
704
704
|
function logImportAttributeIsInvalid(importer) {
|
|
705
705
|
return {
|
|
706
706
|
code: INVALID_IMPORT_ATTRIBUTE,
|
|
707
|
-
message: `Rollup could not statically analyze an import attribute of a dynamic import in "${relativeId(importer)}". Import attributes need to have string keys and values
|
|
707
|
+
message: `Rollup could not statically analyze an import attribute of a dynamic import in "${relativeId(importer)}". Import attributes need to have string keys and values.`
|
|
708
708
|
};
|
|
709
709
|
}
|
|
710
710
|
function logInvalidLogPosition(plugin) {
|
package/dist/es/shared/watch.js
CHANGED
package/dist/getLogFilter.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/parseAst.js
CHANGED
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
package/dist/shared/parseAst.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.48.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.48.1
|
|
4
|
+
Mon, 25 Aug 2025 05:42:43 GMT - commit 8b6b06b16c2198f1e61749f17cbdbc25f2d3d214
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -627,7 +627,7 @@ function logImportOptionsAreInvalid(importer) {
|
|
|
627
627
|
function logImportAttributeIsInvalid(importer) {
|
|
628
628
|
return {
|
|
629
629
|
code: INVALID_IMPORT_ATTRIBUTE,
|
|
630
|
-
message: `Rollup could not statically analyze an import attribute of a dynamic import in "${relativeId(importer)}". Import attributes need to have string keys and values
|
|
630
|
+
message: `Rollup could not statically analyze an import attribute of a dynamic import in "${relativeId(importer)}". Import attributes need to have string keys and values.`
|
|
631
631
|
};
|
|
632
632
|
}
|
|
633
633
|
function logInvalidLogPosition(plugin) {
|
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.48.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.48.1
|
|
4
|
+
Mon, 25 Aug 2025 05:42:43 GMT - commit 8b6b06b16c2198f1e61749f17cbdbc25f2d3d214
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -42,7 +42,7 @@ function _mergeNamespaces(n, m) {
|
|
|
42
42
|
|
|
43
43
|
const promises__namespace = /*#__PURE__*/_interopNamespaceDefault(promises);
|
|
44
44
|
|
|
45
|
-
var version = "4.48.
|
|
45
|
+
var version = "4.48.1";
|
|
46
46
|
|
|
47
47
|
function ensureArray$1(items) {
|
|
48
48
|
if (Array.isArray(items)) {
|
|
@@ -5044,12 +5044,18 @@ class MagicString {
|
|
|
5044
5044
|
if (this.byStart[index] || this.byEnd[index]) return;
|
|
5045
5045
|
|
|
5046
5046
|
let chunk = this.lastSearchedChunk;
|
|
5047
|
+
let previousChunk = chunk;
|
|
5047
5048
|
const searchForward = index > chunk.end;
|
|
5048
5049
|
|
|
5049
5050
|
while (chunk) {
|
|
5050
5051
|
if (chunk.contains(index)) return this._splitChunk(chunk, index);
|
|
5051
5052
|
|
|
5052
5053
|
chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
|
|
5054
|
+
|
|
5055
|
+
// Prevent infinite loop (e.g. via empty chunks, where start === end)
|
|
5056
|
+
if (chunk === previousChunk) return;
|
|
5057
|
+
|
|
5058
|
+
previousChunk = chunk;
|
|
5053
5059
|
}
|
|
5054
5060
|
}
|
|
5055
5061
|
|
|
@@ -8926,7 +8932,7 @@ class LocalVariable extends Variable {
|
|
|
8926
8932
|
isIdentifierNode(declaration.parent.parent.callee.property) &&
|
|
8927
8933
|
declaration.parent.parent.callee.property.name === 'then' &&
|
|
8928
8934
|
isImportExpressionNode(declaration.parent.parent.callee.object)) {
|
|
8929
|
-
declaration.parent.parent.callee.object.includePath(path);
|
|
8935
|
+
declaration.parent.parent.callee.object.includePath(path, context);
|
|
8930
8936
|
}
|
|
8931
8937
|
}
|
|
8932
8938
|
// We need to make sure we include the correct path of the init
|
|
@@ -14686,15 +14692,21 @@ class ImportExpression extends NodeBase {
|
|
|
14686
14692
|
this.resolution = null;
|
|
14687
14693
|
this.resolutionString = null;
|
|
14688
14694
|
}
|
|
14695
|
+
get shouldIncludeDynamicAttributes() {
|
|
14696
|
+
return isFlagSet(this.flags, 536870912 /* Flag.shouldIncludeDynamicAttributes */);
|
|
14697
|
+
}
|
|
14698
|
+
set shouldIncludeDynamicAttributes(value) {
|
|
14699
|
+
this.flags = setFlag(this.flags, 536870912 /* Flag.shouldIncludeDynamicAttributes */, value);
|
|
14700
|
+
}
|
|
14689
14701
|
get withinTopLevelAwait() {
|
|
14690
14702
|
return isFlagSet(this.flags, 134217728 /* Flag.withinTopLevelAwait */);
|
|
14691
14703
|
}
|
|
14692
14704
|
set withinTopLevelAwait(value) {
|
|
14693
14705
|
this.flags = setFlag(this.flags, 134217728 /* Flag.withinTopLevelAwait */, value);
|
|
14694
14706
|
}
|
|
14695
|
-
// Do not bind attributes
|
|
14696
14707
|
bind() {
|
|
14697
14708
|
this.source.bind();
|
|
14709
|
+
this.options?.bind();
|
|
14698
14710
|
}
|
|
14699
14711
|
/**
|
|
14700
14712
|
* Get imported variables for deterministic usage, valid cases are:
|
|
@@ -14777,17 +14789,21 @@ class ImportExpression extends NodeBase {
|
|
|
14777
14789
|
}
|
|
14778
14790
|
include(context, includeChildrenRecursively) {
|
|
14779
14791
|
if (!this.included)
|
|
14780
|
-
this.includeNode();
|
|
14792
|
+
this.includeNode(context);
|
|
14781
14793
|
this.source.include(context, includeChildrenRecursively);
|
|
14794
|
+
if (this.shouldIncludeDynamicAttributes)
|
|
14795
|
+
this.options?.include(context, includeChildrenRecursively);
|
|
14782
14796
|
}
|
|
14783
|
-
includeNode() {
|
|
14797
|
+
includeNode(context) {
|
|
14784
14798
|
this.included = true;
|
|
14799
|
+
if (this.shouldIncludeDynamicAttributes)
|
|
14800
|
+
this.options?.includePath(UNKNOWN_PATH, context);
|
|
14785
14801
|
this.scope.context.includeDynamicImport(this);
|
|
14786
14802
|
this.scope.addAccessedDynamicImport(this);
|
|
14787
14803
|
}
|
|
14788
|
-
includePath(path) {
|
|
14804
|
+
includePath(path, context) {
|
|
14789
14805
|
if (!this.included)
|
|
14790
|
-
this.includeNode();
|
|
14806
|
+
this.includeNode(context);
|
|
14791
14807
|
// Technically, this is not correct as dynamic imports return a Promise.
|
|
14792
14808
|
if (this.hasUnknownAccessedKey)
|
|
14793
14809
|
return;
|
|
@@ -15124,6 +15140,14 @@ class JSXAttribute extends NodeBase {
|
|
|
15124
15140
|
}
|
|
15125
15141
|
if (value) {
|
|
15126
15142
|
code.overwrite(name.end, value.start, ': ', { contentOnly: true });
|
|
15143
|
+
// foo="aa \n aa"
|
|
15144
|
+
if (value instanceof Literal &&
|
|
15145
|
+
typeof value.value === 'string' &&
|
|
15146
|
+
value.value.includes('\n')) {
|
|
15147
|
+
code.overwrite(value.start, value.end, JSON.stringify(value.value), {
|
|
15148
|
+
contentOnly: true
|
|
15149
|
+
});
|
|
15150
|
+
}
|
|
15127
15151
|
}
|
|
15128
15152
|
else {
|
|
15129
15153
|
code.appendLeft(name.end, ': true');
|
|
@@ -15185,10 +15209,35 @@ class JSXExpressionContainer extends NodeBase {
|
|
|
15185
15209
|
}
|
|
15186
15210
|
}
|
|
15187
15211
|
|
|
15212
|
+
const RE_WHITESPACE_TRIM = /^[ \t]*\r?\n[ \t\r\n]*|[ \t]*\r?\n[ \t\r\n]*$/g;
|
|
15213
|
+
const RE_WHITESPACE_MERGE = /[ \t]*\r?\n[ \t\r\n]*/g;
|
|
15214
|
+
class JSXText extends NodeBase {
|
|
15215
|
+
shouldRender() {
|
|
15216
|
+
return !!this.getRenderedText();
|
|
15217
|
+
}
|
|
15218
|
+
render(code) {
|
|
15219
|
+
const { mode } = this.scope.context.options.jsx;
|
|
15220
|
+
if (mode !== 'preserve') {
|
|
15221
|
+
code.overwrite(this.start, this.end, JSON.stringify(this.getRenderedText()), {
|
|
15222
|
+
contentOnly: true
|
|
15223
|
+
});
|
|
15224
|
+
}
|
|
15225
|
+
}
|
|
15226
|
+
getRenderedText() {
|
|
15227
|
+
if (this.renderedText === undefined)
|
|
15228
|
+
this.renderedText = this.value
|
|
15229
|
+
.replace(RE_WHITESPACE_TRIM, '')
|
|
15230
|
+
.replace(RE_WHITESPACE_MERGE, ' ');
|
|
15231
|
+
return this.renderedText;
|
|
15232
|
+
}
|
|
15233
|
+
}
|
|
15234
|
+
JSXText.prototype.includeNode = onlyIncludeSelf;
|
|
15235
|
+
|
|
15188
15236
|
function getRenderedJsxChildren(children) {
|
|
15189
15237
|
let renderedChildren = 0;
|
|
15190
15238
|
for (const child of children) {
|
|
15191
|
-
if (!(child instanceof JSXExpressionContainer && child.expression instanceof JSXEmptyExpression)
|
|
15239
|
+
if (!(child instanceof JSXExpressionContainer && child.expression instanceof JSXEmptyExpression) &&
|
|
15240
|
+
(!(child instanceof JSXText) || child.shouldRender())) {
|
|
15192
15241
|
renderedChildren++;
|
|
15193
15242
|
}
|
|
15194
15243
|
}
|
|
@@ -15266,8 +15315,9 @@ class JSXElementBase extends NodeBase {
|
|
|
15266
15315
|
let childrenEnd = openingEnd;
|
|
15267
15316
|
let firstChild = null;
|
|
15268
15317
|
for (const child of children) {
|
|
15269
|
-
if (child instanceof JSXExpressionContainer &&
|
|
15270
|
-
child.expression instanceof JSXEmptyExpression)
|
|
15318
|
+
if ((child instanceof JSXExpressionContainer &&
|
|
15319
|
+
child.expression instanceof JSXEmptyExpression) ||
|
|
15320
|
+
(child instanceof JSXText && !child.shouldRender())) {
|
|
15271
15321
|
code.remove(childrenEnd, child.end);
|
|
15272
15322
|
}
|
|
15273
15323
|
else {
|
|
@@ -15573,18 +15623,6 @@ class JSXSpreadChild extends NodeBase {
|
|
|
15573
15623
|
}
|
|
15574
15624
|
}
|
|
15575
15625
|
|
|
15576
|
-
class JSXText extends NodeBase {
|
|
15577
|
-
render(code) {
|
|
15578
|
-
const { mode } = this.scope.context.options.jsx;
|
|
15579
|
-
if (mode !== 'preserve') {
|
|
15580
|
-
code.overwrite(this.start, this.end, JSON.stringify(this.value), {
|
|
15581
|
-
contentOnly: true
|
|
15582
|
-
});
|
|
15583
|
-
}
|
|
15584
|
-
}
|
|
15585
|
-
}
|
|
15586
|
-
JSXText.prototype.includeNode = onlyIncludeSelf;
|
|
15587
|
-
|
|
15588
15626
|
class LabeledStatement extends NodeBase {
|
|
15589
15627
|
hasEffects(context) {
|
|
15590
15628
|
const { brokenFlow, includedLabels } = context;
|
|
@@ -20222,13 +20260,18 @@ class Chunk {
|
|
|
20222
20260
|
(resolution instanceof Chunk || resolution instanceof ExternalChunk));
|
|
20223
20261
|
}
|
|
20224
20262
|
getDynamicImportStringAndAttributes(resolution, fileName, node) {
|
|
20263
|
+
const { externalImportAttributes } = this.outputOptions;
|
|
20264
|
+
const keepExternalImportAttributes = ['es', 'cjs'].includes(this.outputOptions.format) && externalImportAttributes;
|
|
20225
20265
|
if (resolution instanceof ExternalModule) {
|
|
20226
20266
|
const chunk = this.externalChunkByModule.get(resolution);
|
|
20227
|
-
|
|
20267
|
+
const dynamicAttributes = chunk.getImportAttributes(this.snippets);
|
|
20268
|
+
return [
|
|
20269
|
+
`'${chunk.getImportPath(fileName)}'`,
|
|
20270
|
+
dynamicAttributes || (keepExternalImportAttributes ? true : null)
|
|
20271
|
+
];
|
|
20228
20272
|
}
|
|
20229
20273
|
let attributes = null;
|
|
20230
|
-
if (
|
|
20231
|
-
this.outputOptions.externalImportAttributes) {
|
|
20274
|
+
if (keepExternalImportAttributes) {
|
|
20232
20275
|
const attributesFromImportAttributes = getAttributesFromImportExpression(node);
|
|
20233
20276
|
attributes =
|
|
20234
20277
|
attributesFromImportAttributes === parseAst_js.EMPTY_OBJECT
|
|
@@ -22661,7 +22704,11 @@ class ModuleLoader {
|
|
|
22661
22704
|
getResolveDynamicImportPromises(module) {
|
|
22662
22705
|
return module.dynamicImports.map(async (dynamicImport) => {
|
|
22663
22706
|
const resolvedId = await this.resolveDynamicImport(module, dynamicImport.argument, module.id, getAttributesFromImportExpression(dynamicImport.node));
|
|
22664
|
-
if (resolvedId
|
|
22707
|
+
if (!resolvedId || typeof resolvedId === 'string') {
|
|
22708
|
+
dynamicImport.node.shouldIncludeDynamicAttributes = true;
|
|
22709
|
+
}
|
|
22710
|
+
else {
|
|
22711
|
+
dynamicImport.node.shouldIncludeDynamicAttributes = !!resolvedId.external;
|
|
22665
22712
|
dynamicImport.id = resolvedId.id;
|
|
22666
22713
|
}
|
|
22667
22714
|
return [dynamicImport, resolvedId];
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup",
|
|
3
|
-
"version": "4.48.
|
|
3
|
+
"version": "4.48.1",
|
|
4
4
|
"description": "Next-generation ES module bundler",
|
|
5
5
|
"main": "dist/rollup.js",
|
|
6
6
|
"module": "dist/es/rollup.js",
|
|
@@ -104,26 +104,26 @@
|
|
|
104
104
|
"homepage": "https://rollupjs.org/",
|
|
105
105
|
"optionalDependencies": {
|
|
106
106
|
"fsevents": "~2.3.2",
|
|
107
|
-
"@rollup/rollup-darwin-arm64": "4.48.
|
|
108
|
-
"@rollup/rollup-android-arm64": "4.48.
|
|
109
|
-
"@rollup/rollup-win32-arm64-msvc": "4.48.
|
|
110
|
-
"@rollup/rollup-freebsd-arm64": "4.48.
|
|
111
|
-
"@rollup/rollup-linux-arm64-gnu": "4.48.
|
|
112
|
-
"@rollup/rollup-linux-arm64-musl": "4.48.
|
|
113
|
-
"@rollup/rollup-android-arm-eabi": "4.48.
|
|
114
|
-
"@rollup/rollup-linux-arm-gnueabihf": "4.48.
|
|
115
|
-
"@rollup/rollup-linux-arm-musleabihf": "4.48.
|
|
116
|
-
"@rollup/rollup-win32-ia32-msvc": "4.48.
|
|
117
|
-
"@rollup/rollup-linux-loongarch64-gnu": "4.48.
|
|
118
|
-
"@rollup/rollup-linux-riscv64-gnu": "4.48.
|
|
119
|
-
"@rollup/rollup-linux-riscv64-musl": "4.48.
|
|
120
|
-
"@rollup/rollup-linux-ppc64-gnu": "4.48.
|
|
121
|
-
"@rollup/rollup-linux-s390x-gnu": "4.48.
|
|
122
|
-
"@rollup/rollup-darwin-x64": "4.48.
|
|
123
|
-
"@rollup/rollup-win32-x64-msvc": "4.48.
|
|
124
|
-
"@rollup/rollup-freebsd-x64": "4.48.
|
|
125
|
-
"@rollup/rollup-linux-x64-gnu": "4.48.
|
|
126
|
-
"@rollup/rollup-linux-x64-musl": "4.48.
|
|
107
|
+
"@rollup/rollup-darwin-arm64": "4.48.1",
|
|
108
|
+
"@rollup/rollup-android-arm64": "4.48.1",
|
|
109
|
+
"@rollup/rollup-win32-arm64-msvc": "4.48.1",
|
|
110
|
+
"@rollup/rollup-freebsd-arm64": "4.48.1",
|
|
111
|
+
"@rollup/rollup-linux-arm64-gnu": "4.48.1",
|
|
112
|
+
"@rollup/rollup-linux-arm64-musl": "4.48.1",
|
|
113
|
+
"@rollup/rollup-android-arm-eabi": "4.48.1",
|
|
114
|
+
"@rollup/rollup-linux-arm-gnueabihf": "4.48.1",
|
|
115
|
+
"@rollup/rollup-linux-arm-musleabihf": "4.48.1",
|
|
116
|
+
"@rollup/rollup-win32-ia32-msvc": "4.48.1",
|
|
117
|
+
"@rollup/rollup-linux-loongarch64-gnu": "4.48.1",
|
|
118
|
+
"@rollup/rollup-linux-riscv64-gnu": "4.48.1",
|
|
119
|
+
"@rollup/rollup-linux-riscv64-musl": "4.48.1",
|
|
120
|
+
"@rollup/rollup-linux-ppc64-gnu": "4.48.1",
|
|
121
|
+
"@rollup/rollup-linux-s390x-gnu": "4.48.1",
|
|
122
|
+
"@rollup/rollup-darwin-x64": "4.48.1",
|
|
123
|
+
"@rollup/rollup-win32-x64-msvc": "4.48.1",
|
|
124
|
+
"@rollup/rollup-freebsd-x64": "4.48.1",
|
|
125
|
+
"@rollup/rollup-linux-x64-gnu": "4.48.1",
|
|
126
|
+
"@rollup/rollup-linux-x64-musl": "4.48.1"
|
|
127
127
|
},
|
|
128
128
|
"dependencies": {
|
|
129
129
|
"@types/estree": "1.0.8"
|
|
@@ -134,15 +134,15 @@
|
|
|
134
134
|
"devDependencies": {
|
|
135
135
|
"@codemirror/commands": "^6.8.1",
|
|
136
136
|
"@codemirror/lang-javascript": "^6.2.4",
|
|
137
|
-
"@codemirror/language": "^6.11.
|
|
137
|
+
"@codemirror/language": "^6.11.3",
|
|
138
138
|
"@codemirror/search": "^6.5.11",
|
|
139
139
|
"@codemirror/state": "^6.5.2",
|
|
140
140
|
"@codemirror/view": "^6.38.1",
|
|
141
141
|
"@eslint/js": "^9.33.0",
|
|
142
|
-
"@inquirer/prompts": "^7.8.
|
|
142
|
+
"@inquirer/prompts": "^7.8.3",
|
|
143
143
|
"@jridgewell/sourcemap-codec": "^1.5.5",
|
|
144
144
|
"@mermaid-js/mermaid-cli": "^11.9.0",
|
|
145
|
-
"@napi-rs/cli": "^3.1.
|
|
145
|
+
"@napi-rs/cli": "^3.1.5",
|
|
146
146
|
"@rollup/plugin-alias": "^5.1.1",
|
|
147
147
|
"@rollup/plugin-buble": "^1.0.3",
|
|
148
148
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
"@rollup/pluginutils": "^5.2.0",
|
|
155
155
|
"@shikijs/vitepress-twoslash": "^3.9.2",
|
|
156
156
|
"@types/mocha": "^10.0.10",
|
|
157
|
-
"@types/node": "^20.19.
|
|
157
|
+
"@types/node": "^20.19.11",
|
|
158
158
|
"@types/picomatch": "^4.0.2",
|
|
159
159
|
"@types/semver": "^7.7.0",
|
|
160
160
|
"@types/yargs-parser": "^21.0.3",
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
"lint-staged": "^16.1.5",
|
|
187
187
|
"locate-character": "^3.0.0",
|
|
188
188
|
"magic-string": "^0.30.17",
|
|
189
|
-
"memfs": "^4.36.
|
|
189
|
+
"memfs": "^4.36.3",
|
|
190
190
|
"mocha": "^11.7.1",
|
|
191
191
|
"nodemon": "^3.1.10",
|
|
192
192
|
"nyc": "^17.1.0",
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
"pretty-bytes": "^7.0.1",
|
|
199
199
|
"pretty-ms": "^9.2.0",
|
|
200
200
|
"requirejs": "^2.3.7",
|
|
201
|
-
"rollup": "^4.46.
|
|
201
|
+
"rollup": "^4.46.3",
|
|
202
202
|
"rollup-plugin-license": "^3.6.0",
|
|
203
203
|
"rollup-plugin-string": "^3.0.0",
|
|
204
204
|
"semver": "^7.7.2",
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
"terser": "^5.43.1",
|
|
211
211
|
"tslib": "^2.8.1",
|
|
212
212
|
"typescript": "^5.9.2",
|
|
213
|
-
"typescript-eslint": "^8.
|
|
213
|
+
"typescript-eslint": "^8.40.0",
|
|
214
214
|
"vite": "^7.1.2",
|
|
215
215
|
"vitepress": "^1.6.4",
|
|
216
216
|
"vue": "^3.5.18",
|