Skip to content

Commit 8cdc145

Browse files
authored
fix(image): prepare for Rollup 3 (#1293)
BREAKING CHANGES: Requires Node 14
1 parent 6bca9da commit 8cdc145

File tree

7 files changed

+44
-35
lines changed

7 files changed

+44
-35
lines changed

β€Žpackages/image/README.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Images are encoded using base64, which means they will be 33% larger than the si
1515

1616
## Requirements
1717

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

2020
## Install
2121

β€Žpackages/image/package.jsonβ€Ž

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@
1313
"author": "Rich Harris",
1414
"homepage": "https://github.com/rollup/plugins/tree/master/packages/image/#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+
"import": "./dist/es/index.js",
20+
"types": "./types/index.d.ts",
21+
"default": "./dist/cjs/index.js"
22+
},
1823
"engines": {
19-
"node": ">= 8.0.0"
24+
"node": ">=14.0.0"
2025
},
2126
"scripts": {
2227
"build": "rollup -c",
@@ -33,6 +38,7 @@
3338
},
3439
"files": [
3540
"dist",
41+
"!dist/**/*.map",
3642
"types",
3743
"README.md",
3844
"LICENSE"
@@ -44,21 +50,24 @@
4450
"modules"
4551
],
4652
"peerDependencies": {
47-
"rollup": "^1.20.0 || ^2.0.0"
53+
"rollup": "^1.20.0||^2.0.0||^3.0.0"
54+
},
55+
"peerDependenciesMeta": {
56+
"rollup": {
57+
"optional": true
58+
}
4859
},
4960
"dependencies": {
50-
"@rollup/pluginutils": "^3.1.0",
51-
"mini-svg-data-uri": "^1.2.3"
61+
"@rollup/pluginutils": "^4.2.1",
62+
"mini-svg-data-uri": "^1.4.4"
5263
},
5364
"devDependencies": {
5465
"@rollup/plugin-buble": "^0.21.3",
55-
"rollup": "^2.67.3"
66+
"rollup": "^3.0.0-7"
5667
},
5768
"types": "./types/index.d.ts",
5869
"ava": {
59-
"babel": {
60-
"compileEnhancements": false
61-
},
70+
"workerThreads": false,
6271
"files": [
6372
"!**/fixtures/**",
6473
"!**/helpers/**",

β€Žpackages/image/rollup.config.jsβ€Ž

Lines changed: 0 additions & 13 deletions
This file was deleted.
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+
};

β€Žpackages/image/test/snapshots/test.js.mdβ€Ž

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.
-48 Bytes
Binary file not shown.

β€Žpnpm-lock.yamlβ€Ž

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

0 commit comments

Comments
Β (0)