rollup 4.48.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/dist/bin/rollup CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  /*
3
3
  @license
4
- Rollup.js v4.48.0
5
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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
 
package/dist/es/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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.0";
30
+ var version = "4.48.1";
31
31
 
32
32
  // src/vlq.ts
33
33
  var comma = ",".charCodeAt(0);
@@ -13531,6 +13531,14 @@ class JSXAttribute extends NodeBase {
13531
13531
  }
13532
13532
  if (value) {
13533
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
+ }
13534
13542
  }
13535
13543
  else {
13536
13544
  code.appendLeft(name.end, ': true');
@@ -13592,10 +13600,35 @@ class JSXExpressionContainer extends NodeBase {
13592
13600
  }
13593
13601
  }
13594
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
+
13595
13627
  function getRenderedJsxChildren(children) {
13596
13628
  let renderedChildren = 0;
13597
13629
  for (const child of children) {
13598
- if (!(child instanceof JSXExpressionContainer && child.expression instanceof JSXEmptyExpression)) {
13630
+ if (!(child instanceof JSXExpressionContainer && child.expression instanceof JSXEmptyExpression) &&
13631
+ (!(child instanceof JSXText) || child.shouldRender())) {
13599
13632
  renderedChildren++;
13600
13633
  }
13601
13634
  }
@@ -13673,8 +13706,9 @@ class JSXElementBase extends NodeBase {
13673
13706
  let childrenEnd = openingEnd;
13674
13707
  let firstChild = null;
13675
13708
  for (const child of children) {
13676
- if (child instanceof JSXExpressionContainer &&
13677
- child.expression instanceof JSXEmptyExpression) {
13709
+ if ((child instanceof JSXExpressionContainer &&
13710
+ child.expression instanceof JSXEmptyExpression) ||
13711
+ (child instanceof JSXText && !child.shouldRender())) {
13678
13712
  code.remove(childrenEnd, child.end);
13679
13713
  }
13680
13714
  else {
@@ -13980,18 +14014,6 @@ class JSXSpreadChild extends NodeBase {
13980
14014
  }
13981
14015
  }
13982
14016
 
13983
- class JSXText extends NodeBase {
13984
- render(code) {
13985
- const { mode } = this.scope.context.options.jsx;
13986
- if (mode !== 'preserve') {
13987
- code.overwrite(this.start, this.end, JSON.stringify(this.value), {
13988
- contentOnly: true
13989
- });
13990
- }
13991
- }
13992
- }
13993
- JSXText.prototype.includeNode = onlyIncludeSelf;
13994
-
13995
14017
  class LabeledStatement extends NodeBase {
13996
14018
  hasEffects(context) {
13997
14019
  const { brokenFlow, includedLabels } = context;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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
 
package/dist/parseAst.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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
 
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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.0";
45
+ var version = "4.48.1";
46
46
 
47
47
  function ensureArray$1(items) {
48
48
  if (Array.isArray(items)) {
@@ -15140,6 +15140,14 @@ class JSXAttribute extends NodeBase {
15140
15140
  }
15141
15141
  if (value) {
15142
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
+ }
15143
15151
  }
15144
15152
  else {
15145
15153
  code.appendLeft(name.end, ': true');
@@ -15201,10 +15209,35 @@ class JSXExpressionContainer extends NodeBase {
15201
15209
  }
15202
15210
  }
15203
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
+
15204
15236
  function getRenderedJsxChildren(children) {
15205
15237
  let renderedChildren = 0;
15206
15238
  for (const child of children) {
15207
- if (!(child instanceof JSXExpressionContainer && child.expression instanceof JSXEmptyExpression)) {
15239
+ if (!(child instanceof JSXExpressionContainer && child.expression instanceof JSXEmptyExpression) &&
15240
+ (!(child instanceof JSXText) || child.shouldRender())) {
15208
15241
  renderedChildren++;
15209
15242
  }
15210
15243
  }
@@ -15282,8 +15315,9 @@ class JSXElementBase extends NodeBase {
15282
15315
  let childrenEnd = openingEnd;
15283
15316
  let firstChild = null;
15284
15317
  for (const child of children) {
15285
- if (child instanceof JSXExpressionContainer &&
15286
- child.expression instanceof JSXEmptyExpression) {
15318
+ if ((child instanceof JSXExpressionContainer &&
15319
+ child.expression instanceof JSXEmptyExpression) ||
15320
+ (child instanceof JSXText && !child.shouldRender())) {
15287
15321
  code.remove(childrenEnd, child.end);
15288
15322
  }
15289
15323
  else {
@@ -15589,18 +15623,6 @@ class JSXSpreadChild extends NodeBase {
15589
15623
  }
15590
15624
  }
15591
15625
 
15592
- class JSXText extends NodeBase {
15593
- render(code) {
15594
- const { mode } = this.scope.context.options.jsx;
15595
- if (mode !== 'preserve') {
15596
- code.overwrite(this.start, this.end, JSON.stringify(this.value), {
15597
- contentOnly: true
15598
- });
15599
- }
15600
- }
15601
- }
15602
- JSXText.prototype.includeNode = onlyIncludeSelf;
15603
-
15604
15626
  class LabeledStatement extends NodeBase {
15605
15627
  hasEffects(context) {
15606
15628
  const { brokenFlow, includedLabels } = context;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.48.0
4
- Sat, 23 Aug 2025 06:19:18 GMT - commit 77bb1ae9293a35036cdccfc2ba34faa0fe703b05
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup",
3
- "version": "4.48.0",
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",
@@ -37,8 +37,8 @@
37
37
  "scripts": {
38
38
  "build": "concurrently -c green,blue \"npm run build:wasm\" \"npm:build:ast-converters\" && concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js\" && npm run build:copy-native",
39
39
  "build:quick": "concurrently -c green,blue 'npm:build:napi' 'npm:build:cjs' && npm run build:copy-native",
40
- "build:napi": "napi build --platform --dts native.d.ts --no-js --output-dir . --manifest-path rust/bindings_napi/Cargo.toml",
41
- "build:wasm": "cross-env RUSTFLAGS=\"-C opt-level=z\" wasm-pack build rust/bindings_wasm --out-dir ../../wasm --target web --no-pack && shx rm wasm/.gitignore",
40
+ "build:napi": "napi build --cwd rust/bindings_napi --platform --dts ../../native.d.ts --no-js --output-dir ../.. --package-json-path ../../package.json",
41
+ "build:wasm": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm --target web --no-pack && shx rm wasm/.gitignore",
42
42
  "build:wasm:node": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm-node --target nodejs --no-pack && shx rm wasm-node/.gitignore",
43
43
  "update:napi": "npm run build:napi && npm run build:copy-native",
44
44
  "build:js": "rollup --config rollup.config.ts --configPlugin typescript --forceExit",
@@ -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.0",
108
- "@rollup/rollup-android-arm64": "4.48.0",
109
- "@rollup/rollup-win32-arm64-msvc": "4.48.0",
110
- "@rollup/rollup-freebsd-arm64": "4.48.0",
111
- "@rollup/rollup-linux-arm64-gnu": "4.48.0",
112
- "@rollup/rollup-linux-arm64-musl": "4.48.0",
113
- "@rollup/rollup-android-arm-eabi": "4.48.0",
114
- "@rollup/rollup-linux-arm-gnueabihf": "4.48.0",
115
- "@rollup/rollup-linux-arm-musleabihf": "4.48.0",
116
- "@rollup/rollup-win32-ia32-msvc": "4.48.0",
117
- "@rollup/rollup-linux-loongarch64-gnu": "4.48.0",
118
- "@rollup/rollup-linux-riscv64-gnu": "4.48.0",
119
- "@rollup/rollup-linux-riscv64-musl": "4.48.0",
120
- "@rollup/rollup-linux-ppc64-gnu": "4.48.0",
121
- "@rollup/rollup-linux-s390x-gnu": "4.48.0",
122
- "@rollup/rollup-darwin-x64": "4.48.0",
123
- "@rollup/rollup-win32-x64-msvc": "4.48.0",
124
- "@rollup/rollup-freebsd-x64": "4.48.0",
125
- "@rollup/rollup-linux-x64-gnu": "4.48.0",
126
- "@rollup/rollup-linux-x64-musl": "4.48.0"
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"