Skip to content

Commit 552f5d6

Browse files
committed
fix(legacy): prepare for Rollup 3
BREAKING CHANGES: Requires Node 14
1 parent 32aa6d2 commit 552f5d6

File tree

7 files changed

+75
-33
lines changed

7 files changed

+75
-33
lines changed

packages/legacy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
## Requirements
1515

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

1818
## Install
1919

packages/legacy/package.json

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@
1313
"author": "Rich Harris",
1414
"homepage": "https://github.com/rollup/plugins/tree/master/packages/legacy/#readme",
1515
"bugs": "https://github.com/rollup/plugins/issues",
16-
"main": "dist/index.js",
17-
"module": "dist/index.es.js",
16+
"main": "./dist/cjs/index.js",
17+
"module": "./dist/es/index.js",
18+
"exports": {
19+
"require": "./dist/cjs/index.js",
20+
"import": "./dist/es/index.js"
21+
},
22+
"engines": {
23+
"node": ">=14.0.0"
24+
},
1825
"scripts": {
1926
"build": "rollup -c",
2027
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
@@ -29,7 +36,7 @@
2936
"test": "ava"
3037
},
3138
"files": [
32-
"dist",
39+
"dist/**/*.{js,json}",
3340
"types",
3441
"README.md",
3542
"LICENSE"
@@ -39,20 +46,23 @@
3946
"plugin"
4047
],
4148
"peerDependencies": {
42-
"rollup": "^1.20.0||^2.0.0"
49+
"rollup": "^1.20.0||^2.0.0||^3.0.0"
50+
},
51+
"peerDependenciesMeta": {
52+
"rollup": {
53+
"optional": true
54+
}
4355
},
4456
"dependencies": {
45-
"@rollup/pluginutils": "^4.1.0"
57+
"@rollup/pluginutils": "^4.2.1"
4658
},
4759
"devDependencies": {
4860
"@rollup/plugin-buble": "^0.21.3",
49-
"del-cli": "^3.0.1",
50-
"rollup": "^2.67.3"
61+
"del-cli": "^5.0.0",
62+
"rollup": "^3.0.0-7"
5163
},
5264
"ava": {
53-
"babel": {
54-
"compileEnhancements": false
55-
},
65+
"workerThreads": false,
5666
"files": [
5767
"!**/fixtures/**",
5868
"!**/helpers/**",

packages/legacy/rollup.config.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

packages/legacy/rollup.config.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { readFileSync } from 'fs';
2+
3+
import buble from '@rollup/plugin-buble';
4+
5+
import { createConfig } from '../../shared/rollup.config.mjs';
6+
7+
export default {
8+
...createConfig({
9+
pkg: JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'))
10+
}),
11+
input: 'src/index.js',
12+
plugins: [buble()]
13+
};

pnpm-lock.yaml

Lines changed: 38 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shared/rollup.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ export function createConfig({ pkg, external = [] }) {
2323
output: [
2424
{
2525
format: 'cjs',
26-
file: pkg.main,
26+
file: pkg.exports.require,
2727
exports: 'named',
2828
footer: 'module.exports = Object.assign(exports.default, exports);',
2929
sourcemap: true
3030
},
3131
{
3232
format: 'es',
33-
file: pkg.module,
33+
file: pkg.exports.import,
3434
plugins: [emitModulePackageFile()],
3535
sourcemap: true
3636
}

tsconfig.base.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"pretty": true,
1313
"sourceMap": true,
1414
"strict": true,
15-
"target": "es2017"
15+
"target": "es2019"
1616
},
1717
"exclude": ["dist", "node_modules", "test/types"]
1818
}

0 commit comments

Comments
 (0)