Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rollup/plugins
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bc233d6bcdc772de279138bfce8dcdf2afa4153a
Choose a base ref
...
head repository: rollup/plugins
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bbe2689aef1d66afb676312c0b4cd679ae6045f7
Choose a head ref

Commits on Oct 9, 2022

  1. chore(release): inject v5.0.0

    Release Workflow committed Oct 9, 2022
    Copy the full SHA
    facf7cb View commit details

Commits on Oct 10, 2022

  1. fix(json): prepare for Rollup 3 (#1291)

    BREAKING CHANGES: Requires Node 14
    lukastaegert authored Oct 10, 2022
    Copy the full SHA
    fe33e68 View commit details
  2. chore(release): json v5.0.0

    Release Workflow committed Oct 10, 2022
    Copy the full SHA
    0c03017 View commit details
  3. fix(legacy): prepare for Rollup 3 (#1290)

    BREAKING CHANGES: Requires Node 14
    lukastaegert authored Oct 10, 2022
    Copy the full SHA
    22dc8c5 View commit details
  4. chore(release): legacy v3.0.0

    Release Workflow committed Oct 10, 2022
    Copy the full SHA
    1284c11 View commit details
  5. fix(multi-entry): prepare for Rollup 3 (#1289)

    BREAKING CHANGES: Requires Node 14
    lukastaegert authored Oct 10, 2022
    Copy the full SHA
    b2253ba View commit details
  6. chore(release): multi-entry v5.0.0

    Release Workflow committed Oct 10, 2022
    Copy the full SHA
    cafc32b View commit details
  7. fix(node-resolve): prepare for Rollup 3 (#1288)

    BREAKING CHANGES: Requires Node 14
    lukastaegert authored Oct 10, 2022
    Copy the full SHA
    ec4d28e View commit details
  8. chore(release): node-resolve v15.0.0

    Release Workflow committed Oct 10, 2022
    Copy the full SHA
    6bd4ce7 View commit details
  9. fix(pluginutils): prepare for Rollup 3 (#1287)

    BREAKING CHANGES: Requires Node 14
    lukastaegert authored Oct 10, 2022
    Copy the full SHA
    17865bc View commit details
  10. chore(release): pluginutils v5.0.0

    Release Workflow committed Oct 10, 2022
    Copy the full SHA
    62f0a13 View commit details
  11. fix(replace): prepare for Rollup 3 (#1286)

    BREAKING CHANGES: Requires Node 14
    lukastaegert authored Oct 10, 2022
    Copy the full SHA
    cba9788 View commit details
  12. chore(release): replace v5.0.0

    Release Workflow committed Oct 10, 2022
    Copy the full SHA
    bdc099e View commit details
  13. fix(run): prepare for Rollup 3 (#1285)

    BREAKING CHANGES: Requires Node 14
    lukastaegert authored Oct 10, 2022
    Copy the full SHA
    51187d5 View commit details
  14. chore(release): run v3.0.0

    Release Workflow committed Oct 10, 2022
    Copy the full SHA
    bb4a21a View commit details
  15. fix(strip): prepare for Rollup 3 (#1284)

    BREAKING CHANGES: Requires Node 14
    lukastaegert authored Oct 10, 2022
    Copy the full SHA
    b2d0988 View commit details
  16. chore(release): strip v3.0.0

    Release Workflow committed Oct 10, 2022
    Copy the full SHA
    1a246f9 View commit details
  17. fix(sucrase): prepare for Rollup 3 (#1283)

    BREAKING CHANGES: Requires Node 14
    lukastaegert authored Oct 10, 2022
    Copy the full SHA
    e7d9c37 View commit details
  18. chore(release): sucrase v5.0.0

    Release Workflow committed Oct 10, 2022
    Copy the full SHA
    33cf1ff View commit details
  19. fix(typescript): prepare for Rollup 3 (#1282)

    BREAKING CHANGES: Requires Node 14
    lukastaegert authored Oct 10, 2022
    Copy the full SHA
    3ef65ec View commit details
  20. chore(release): typescript v9.0.0

    Release Workflow committed Oct 10, 2022
    Copy the full SHA
    bffcfb2 View commit details
  21. fix(url): prepare for Rollup 3 (#1281)

    BREAKING CHANGES: Requires Node 14
    lukastaegert authored Oct 10, 2022
    Copy the full SHA
    05b8781 View commit details
  22. chore(release): url v8.0.0

    Release Workflow committed Oct 10, 2022
    Copy the full SHA
    971e3b3 View commit details
  23. fix(virtual): prepare for Rollup 3 (#1280)

    BREAKING CHANGES: Requires Node 14
    lukastaegert authored Oct 10, 2022
    Copy the full SHA
    8da116c View commit details
  24. chore(release): virtual v3.0.0

    Release Workflow committed Oct 10, 2022
    Copy the full SHA
    61c6b00 View commit details
  25. fix(wasm): prepare for Rollup 3 (#1301)

    BREAKING CHANGES: Requires Node 14
    lukastaegert authored Oct 10, 2022
    Copy the full SHA
    09df3b8 View commit details
  26. chore(release): wasm v6.0.0

    Release Workflow committed Oct 10, 2022
    Copy the full SHA
    a2437c7 View commit details
  27. fix(yaml): prepare for Rollup 3 (#1302)

    BREAKING CHANGES: Requires Node 14
    lukastaegert authored Oct 10, 2022
    Copy the full SHA
    30634ac View commit details
  28. chore(release): yaml v4.0.0

    Release Workflow committed Oct 10, 2022
    Copy the full SHA
    fa80acc View commit details

Commits on Oct 11, 2022

  1. fix(typescript): fix ESM build (#1311)

    Do not use named imports from TypeScript
    lukastaegert authored Oct 11, 2022
    Copy the full SHA
    dfd4de3 View commit details
  2. chore(release): typescript v9.0.1

    Release Workflow committed Oct 11, 2022
    Copy the full SHA
    c909327 View commit details

Commits on Oct 13, 2022

  1. fix(pluginutils): Move @types/estree to dependencies (fixes #1315) (#…

    …1320)
    
    estree types are required for downstream packages, since
    pluginutils/types/index.d.ts makes use of them.
    meyfa authored Oct 13, 2022
    Copy the full SHA
    89450a8 View commit details
  2. chore(release): pluginutils v5.0.1

    Release Workflow committed Oct 13, 2022
    Copy the full SHA
    77178b3 View commit details

Commits on Oct 15, 2022

  1. fix(inject): detect references inside object destructuring (#1241)

    * Fix: doesn't detect references in destructed object value
    
    * Fix: pass the linetr
    
    * Update snapshot
    eight04 authored Oct 15, 2022
    Copy the full SHA
    b64cd9c View commit details
  2. chore(release): inject v5.0.1

    Release Workflow committed Oct 15, 2022
    Copy the full SHA
    bbe2689 View commit details
Showing with 1,798 additions and 1,693 deletions.
  1. +16 −0 packages/inject/CHANGELOG.md
  2. +1 −1 packages/inject/package.json
  3. +1 −1 packages/inject/src/index.js
  4. +3 −0 packages/inject/test/fixtures/shorthand-assignment/input.js
  5. +5 −0 packages/inject/test/fixtures/shorthand-func-fallback/input.js
  6. +5 −0 packages/inject/test/fixtures/shorthand-func/input.js
  7. +33 −0 packages/inject/test/snapshots/test.js.md
  8. BIN packages/inject/test/snapshots/test.js.snap
  9. +12 −0 packages/inject/test/test.js
  10. +12 −0 packages/json/CHANGELOG.md
  11. +4 −2 packages/json/README.md
  12. +24 −12 packages/json/package.json
  13. +0 −15 packages/json/rollup.config.js
  14. +13 −0 packages/json/rollup.config.mjs
  15. +33 −33 packages/json/test/snapshots/test.js.md
  16. BIN packages/json/test/snapshots/test.js.snap
  17. +1 −1 packages/json/test/test.js
  18. +8 −0 packages/legacy/CHANGELOG.md
  19. +1 −1 packages/legacy/README.md
  20. +23 −10 packages/legacy/package.json
  21. +0 −13 packages/legacy/rollup.config.js
  22. +13 −0 packages/legacy/rollup.config.mjs
  23. +8 −0 packages/multi-entry/CHANGELOG.md
  24. +1 −1 packages/multi-entry/README.md
  25. +18 −10 packages/multi-entry/package.json
  26. +0 −10 packages/multi-entry/rollup.config.js
  27. +11 −0 packages/multi-entry/rollup.config.mjs
  28. +1 −0 packages/multi-entry/test/node_modules/current-package
  29. +12 −2 packages/multi-entry/test/{test.js → test.mjs}
  30. +8 −0 packages/node-resolve/CHANGELOG.md
  31. +1 −1 packages/node-resolve/README.md
  32. +22 −18 packages/node-resolve/package.json
  33. +0 −18 packages/node-resolve/rollup.config.js
  34. +13 −0 packages/node-resolve/rollup.config.mjs
  35. +3 −1 packages/node-resolve/src/index.js
  36. +31 −0 packages/node-resolve/src/rollup-version.js
  37. +5 −3 packages/node-resolve/test/jail.js
  38. +1 −0 packages/node-resolve/test/node_modules/current-package
  39. +6 −4 packages/node-resolve/test/{side-effects.js → side-effects.mjs}
  40. BIN packages/node-resolve/test/snapshots/dedupe-custom.js.snap
  41. BIN packages/node-resolve/test/snapshots/dedupe.js.snap
  42. +0 −20 packages/node-resolve/test/snapshots/jail.js.md
  43. BIN packages/node-resolve/test/snapshots/jail.js.snap
  44. BIN packages/node-resolve/test/snapshots/only.js.snap
  45. +4 −2 packages/node-resolve/test/snapshots/prefer-builtins.js.md
  46. BIN packages/node-resolve/test/snapshots/prefer-builtins.js.snap
  47. BIN packages/node-resolve/test/snapshots/root-dir.js.snap
  48. BIN packages/node-resolve/test/snapshots/side-effects.js.snap
  49. +2 −2 packages/node-resolve/test/snapshots/{side-effects.js.md → side-effects.mjs.md}
  50. BIN packages/node-resolve/test/snapshots/side-effects.mjs.snap
  51. BIN packages/node-resolve/test/snapshots/test.js.snap
  52. +3 −77 packages/node-resolve/test/snapshots/{test.js.md → test.mjs.md}
  53. BIN packages/node-resolve/test/snapshots/test.mjs.snap
  54. +27 −31 packages/node-resolve/test/{test.js → test.mjs}
  55. +16 −0 packages/pluginutils/CHANGELOG.md
  56. +1 −1 packages/pluginutils/README.md
  57. +26 −16 packages/pluginutils/package.json
  58. +5 −9 packages/pluginutils/{rollup.config.js → rollup.config.mjs}
  59. +1 −1 packages/pluginutils/src/addExtension.ts
  60. +1 −2 packages/pluginutils/src/attachScopes.ts
  61. +1 −1 packages/pluginutils/src/createFilter.ts
  62. +1 −1 packages/pluginutils/src/dataToEsm.ts
  63. +1 −1 packages/pluginutils/src/extractAssignedNames.ts
  64. +1 −1 packages/pluginutils/src/makeLegalIdentifier.ts
  65. +1 −1 packages/pluginutils/src/normalizePath.ts
  66. +0 −1 packages/pluginutils/test/attachScopes.ts
  67. +0 −1 packages/pluginutils/types/index.d.ts
  68. +8 −0 packages/replace/CHANGELOG.md
  69. +1 −1 packages/replace/README.md
  70. +25 −11 packages/replace/package.json
  71. +0 −15 packages/replace/rollup.config.js
  72. +13 −0 packages/replace/rollup.config.mjs
  73. +1 −1 packages/replace/test/form.js
  74. +1 −1 packages/replace/test/function.js
  75. +2 −2 packages/replace/test/misc.js
  76. +1 −1 packages/replace/test/sourcemaps.js
  77. +8 −0 packages/run/CHANGELOG.md
  78. +4 −0 packages/run/README.md
  79. +24 −15 packages/run/package.json
  80. +0 −13 packages/run/rollup.config.js
  81. +7 −0 packages/run/rollup.config.mjs
  82. +1 −1 packages/run/src/index.ts
  83. +8 −0 packages/strip/CHANGELOG.md
  84. +1 −1 packages/strip/README.md
  85. +23 −12 packages/strip/package.json
  86. +0 −10 packages/strip/rollup.config.js
  87. +11 −0 packages/strip/rollup.config.mjs
  88. +105 −105 packages/strip/test/snapshots/test.js.md
  89. BIN packages/strip/test/snapshots/test.js.snap
  90. +0 −1 packages/strip/test/test.js
  91. +8 −0 packages/sucrase/CHANGELOG.md
  92. +1 −1 packages/sucrase/README.md
  93. +21 −11 packages/sucrase/package.json
  94. +0 −12 packages/sucrase/rollup.config.js
  95. +11 −0 packages/sucrase/rollup.config.mjs
  96. +6 −6 packages/sucrase/src/index.js
  97. BIN packages/sucrase/test/snapshots/test.js.snap
  98. +16 −0 packages/typescript/CHANGELOG.md
  99. +1 −1 packages/typescript/README.md
  100. +0 −1 packages/typescript/ava.config.js
  101. +1 −0 packages/typescript/ava.config.mjs
  102. +20 −12 packages/typescript/package.json
  103. +0 −15 packages/typescript/rollup.config.js
  104. +7 −0 packages/typescript/rollup.config.mjs
  105. +2 −3 packages/typescript/src/customTransformers.ts
  106. +2 −2 packages/typescript/src/diagnostics/toWarning.ts
  107. +1 −1 packages/typescript/src/index.ts
  108. +1 −1 packages/typescript/src/moduleResolution.ts
  109. +2 −2 packages/typescript/src/options/interfaces.ts
  110. +2 −2 packages/typescript/src/options/plugin.ts
  111. +4 −4 packages/typescript/src/options/tsconfig.ts
  112. +2 −1 packages/typescript/src/preflight.ts
  113. +4 −1 packages/typescript/src/tslib.ts
  114. +3 −3 packages/typescript/src/watchProgram.ts
  115. +10 −9 packages/typescript/test/declarations.ts
  116. +1 −1 packages/typescript/test/fixtures/incremental-single/tsconfig.tsbuildinfo
  117. +1 −0 packages/typescript/test/node_modules/current-package
  118. BIN packages/typescript/test/snapshots/tslib.ts.snap
  119. BIN packages/typescript/test/snapshots/warnings.ts.snap
  120. +28 −29 packages/typescript/test/test.js
  121. +23 −0 packages/typescript/test/test.mjs
  122. +2 −3 packages/typescript/test/tslib.ts
  123. +8 −0 packages/url/CHANGELOG.md
  124. +1 −1 packages/url/README.md
  125. +21 −12 packages/url/package.json
  126. +0 −12 packages/url/rollup.config.js
  127. +11 −0 packages/url/rollup.config.mjs
  128. +15 −15 packages/url/test/snapshots/test.js.md
  129. BIN packages/url/test/snapshots/test.js.snap
  130. +8 −0 packages/virtual/CHANGELOG.md
  131. +1 −1 packages/virtual/README.md
  132. +21 −19 packages/virtual/package.json
  133. +0 −14 packages/virtual/rollup.config.js
  134. +13 −0 packages/virtual/rollup.config.mjs
  135. +8 −0 packages/wasm/CHANGELOG.md
  136. +1 −1 packages/wasm/README.md
  137. +18 −11 packages/wasm/package.json
  138. 0 packages/wasm/rollup.config.mjs
  139. +1 −1 packages/wasm/src/helper.ts
  140. +1 −1 packages/wasm/src/index.ts
  141. +8 −0 packages/yaml/CHANGELOG.md
  142. +1 −1 packages/yaml/README.md
  143. +24 −15 packages/yaml/package.json
  144. +0 −10 packages/yaml/rollup.config.js
  145. +11 −0 packages/yaml/rollup.config.mjs
  146. +3 −4 packages/yaml/src/index.js
  147. +3 −3 packages/yaml/test/fixtures/spec.json
  148. +0 −16 packages/yaml/test/test.js
  149. +0 −1 packages/yaml/test/types.ts
  150. +0 −8 packages/yaml/types/index.d.ts
  151. +755 −910 pnpm-lock.yaml
  152. +1 −1 shared/ava.config.mjs
16 changes: 16 additions & 0 deletions packages/inject/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @rollup/plugin-inject ChangeLog

## v5.0.1

_2022-10-15_

### Bugfixes

- fix: detect references inside object destructuring [#1241](https://github.com/rollup/plugins/pull/1241)

## v5.0.0

_2022-10-09_

### Breaking Changes

- fix: prepare for Rollup 3 [#1292](https://github.com/rollup/plugins/pull/1292)

## v4.0.4

_2021-12-28_
2 changes: 1 addition & 1 deletion packages/inject/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rollup/plugin-inject",
"version": "4.0.4",
"version": "5.0.1",
"publishConfig": {
"access": "public"
},
2 changes: 1 addition & 1 deletion packages/inject/src/index.js
Original file line number Diff line number Diff line change
@@ -167,7 +167,7 @@ export default function inject(options) {

// special case – shorthand properties. because node.key === node.value,
// we can't differentiate once we've descended into the node
if (node.type === 'Property' && node.shorthand) {
if (node.type === 'Property' && node.shorthand && node.value.type === 'Identifier') {
const { name } = node.key;
handleReference(node, name, name);
this.skip();
3 changes: 3 additions & 0 deletions packages/inject/test/fixtures/shorthand-assignment/input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const { Promise = "fallback" } = foo;
console.log(Promise);

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function foo({bar = Promise}) {
console.log(bar);
}
foo();

5 changes: 5 additions & 0 deletions packages/inject/test/fixtures/shorthand-func/input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function foo({Promise}) {
console.log(Promise);
}
foo();

33 changes: 33 additions & 0 deletions packages/inject/test/snapshots/test.js.md
Original file line number Diff line number Diff line change
@@ -103,6 +103,39 @@ Generated by [AVA](https://avajs.dev).
polyfills.Promise.resolve().then(() => 'it works');␊
`

## handles shorthand properties (as assignment)

> Snapshot 1
`const { Promise = "fallback" } = foo;␊
console.log(Promise);␊
`

## handles shorthand properties in function

> Snapshot 1
`function foo({Promise}) {␊
console.log(Promise);␊
}␊
foo();␊
`

## handles shorthand properties in function (as fallback value)

> Snapshot 1
`import { Promise as Promise } from 'es6-promise';␊
function foo({bar = Promise}) {␊
console.log(bar);␊
}␊
foo();␊
`

## handles redundant keys

> Snapshot 1
Binary file modified packages/inject/test/snapshots/test.js.snap
Binary file not shown.
12 changes: 12 additions & 0 deletions packages/inject/test/test.js
Original file line number Diff line number Diff line change
@@ -70,6 +70,18 @@ test('handles shorthand properties', (t) => {
compare(t, 'shorthand', { Promise: ['es6-promise', 'Promise'] });
});

test('handles shorthand properties (as assignment)', (t) => {
compare(t, 'shorthand-assignment', { Promise: ['es6-promise', 'Promise'] });
});

test('handles shorthand properties in function', (t) => {
compare(t, 'shorthand-func', { Promise: ['es6-promise', 'Promise'] });
});

test('handles shorthand properties in function (as fallback value)', (t) => {
compare(t, 'shorthand-func-fallback', { Promise: ['es6-promise', 'Promise'] });
});

test('handles redundant keys', (t) => {
compare(t, 'redundant-keys', {
Buffer: 'Buffer',
12 changes: 12 additions & 0 deletions packages/json/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @rollup/plugin-json ChangeLog

## v5.0.0

_2022-10-10_

### Breaking Changes

- fix: prepare for Rollup 3 [#1291](https://github.com/rollup/plugins/pull/1291)

### Updates

- chore: update dependencies ([678125b](https://github.com/rollup/plugins/commit/678125b5396bd3e8193c39d7d90e33d3f76cf7d8))

## v4.1.0

_2020-06-05_
6 changes: 4 additions & 2 deletions packages/json/README.md
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v8.0.0+) and Rollup v1.20.0+.
This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

@@ -46,7 +46,9 @@ With an accompanying file `src/index.js`, the local `package.json` file would no

```js
// src/index.js
import pkg from './package.json';
import { readFileSync } from 'fs';

const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'));
console.log(`running version ${pkg.version}`);
```
36 changes: 24 additions & 12 deletions packages/json/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rollup/plugin-json",
"version": "4.1.0",
"version": "5.0.0",
"publishConfig": {
"access": "public"
},
@@ -13,8 +13,16 @@
"author": "rollup",
"homepage": "https://github.com/rollup/plugins/tree/master/packages/json#readme",
"bugs": "https://github.com/rollup/plugins/issues",
"main": "dist/index.js",
"module": "dist/index.es.js",
"main": "./dist/cjs/index.js",
"module": "./dist/es/index.js",
"exports": {
"types": "./types/index.d.ts",
"import": "./dist/es/index.js",
"default": "./dist/cjs/index.js"
},
"engines": {
"node": ">=14.0.0"
},
"scripts": {
"build": "rollup -c",
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
@@ -31,6 +39,7 @@
},
"files": [
"dist",
"!dist/**/*.map",
"types",
"README.md",
"LICENSE"
@@ -44,22 +53,25 @@
"modules"
],
"peerDependencies": {
"rollup": "^1.20.0 || ^2.0.0"
"rollup": "^1.20.0||^2.0.0||^3.0.0"
},
"peerDependenciesMeta": {
"rollup": {
"optional": true
}
},
"dependencies": {
"@rollup/pluginutils": "^3.0.8"
"@rollup/pluginutils": "^4.2.1"
},
"devDependencies": {
"@rollup/plugin-buble": "^0.21.0",
"@rollup/plugin-node-resolve": "^8.4.0",
"rollup": "^2.67.3",
"source-map-support": "^0.5.19"
"@rollup/plugin-node-resolve": "^14.1.0",
"rollup": "^3.0.0-7",
"source-map-support": "^0.5.21"
},
"types": "types/index.d.ts",
"types": "./types/index.d.ts",
"ava": {
"babel": {
"compileEnhancements": false
},
"workerThreads": false,
"files": [
"!**/fixtures/**",
"!**/helpers/**",
15 changes: 0 additions & 15 deletions packages/json/rollup.config.js

This file was deleted.

13 changes: 13 additions & 0 deletions packages/json/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { readFileSync } from 'fs';

import buble from '@rollup/plugin-buble';

import { createConfig } from '../../shared/rollup.config.mjs';

export default {
...createConfig({
pkg: JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'))
}),
input: 'src/index.js',
plugins: [buble()]
};
66 changes: 33 additions & 33 deletions packages/json/test/snapshots/test.js.md
Original file line number Diff line number Diff line change
@@ -2,41 +2,17 @@

The actual snapshot is saved in `test.js.snap`.

Generated by [AVA](https://ava.li).
Generated by [AVA](https://avajs.dev).

## generates correct code with compact=true

> Snapshot 1
'export var validKey=true;export var nested={subKey:"ok"};export var array=[1,"2"];export default{validKey:validKey,"invalid-key":1,nested:nested,array:array,"function":"not used","null":null};'

## generates correct code with namedExports=false

> Snapshot 1
`export default {␊
validKey: true,␊
"invalid-key": 1,␊
nested: {␊
subKey: "ok"␊
},␊
array: [␊
1,␊
"2"␊
],␊
"function": "not used",␊
"null": null␊
};`

## generates correct code with preferConst
## generates properly formatted code

> Snapshot 1
`export const validKey = true;␊
export const nested = {␊
`export var validKey = true;␊
export var nested = {␊
subKey: "ok"␊
};␊
export const array = [␊
export var array = [␊
1,␊
"2"␊
];␊
@@ -50,15 +26,15 @@ Generated by [AVA](https://ava.li).
};␊
`

## generates properly formatted code
## generates correct code with preferConst

> Snapshot 1
`export var validKey = true;␊
export var nested = {␊
`export const validKey = true;␊
export const nested = {␊
subKey: "ok"␊
};␊
export var array = [␊
export const array = [␊
1,␊
"2"␊
];␊
@@ -93,3 +69,27 @@ Generated by [AVA](https://ava.li).
"null": null␊
};␊
`

## generates correct code with compact=true

> Snapshot 1
'export var validKey=true;export var nested={subKey:"ok"};export var array=[1,"2"];export default{validKey:validKey,"invalid-key":1,nested:nested,array:array,"function":"not used","null":null};'

## generates correct code with namedExports=false

> Snapshot 1
`export default {␊
validKey: true,␊
"invalid-key": 1,␊
nested: {␊
subKey: "ok"␊
},␊
array: [␊
1,␊
"2"␊
],␊
"function": "not used",␊
"null": null␊
};`
Binary file modified packages/json/test/snapshots/test.js.snap
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/json/test/test.js
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ test('generates named exports', async (t) => {
plugins: [json()]
});

const { code, result } = await testBundle(t, bundle, { exports: {} });
const { code, result } = await testBundle(t, bundle, { inject: { exports: {} } });

t.is(result.version, '1.33.7');
t.is(code.indexOf('this-should-be-excluded'), -1, 'should exclude unused properties');
8 changes: 8 additions & 0 deletions packages/legacy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @rollup/plugin-legacy ChangeLog

## v3.0.0

_2022-10-10_

### Breaking Changes

- fix: prepare for Rollup 3 [#1290](https://github.com/rollup/plugins/pull/1290)

## v2.2.0

_2021-07-26_
2 changes: 1 addition & 1 deletion packages/legacy/README.md
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v8.0.0+) and Rollup v1.20.0+.
This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Loading