Skip to content

Commit aebf392

Browse files
committed
module add 'rollup-plugin-img',
add sample images
1 parent b943c8b commit aebf392

File tree

12 files changed

+21
-11
lines changed

12 files changed

+21
-11
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"react/jsx-indent" : ["error", 4],
2424
"react/jsx-indent-props" : ["error", 4],
2525
"import/no-extraneous-dependencies": "off",
26+
"import/prefer-default-export": "off",
2627
"react/destructuring-assignment": "off"
2728
}
2829
}

example/images/1.jpg

121 KB
Loading

example/images/2.jpg

124 KB
Loading

example/images/3.jpg

169 KB
Loading

example/images/4.jpg

454 KB
Loading

example/images/5.jpg

197 KB
Loading

example/images/6.jpg

73.6 KB
Loading

example/images/7.jpg

140 KB
Loading

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"react-dom": "^16.4.2",
5353
"rollup": "^0.65.2",
5454
"rollup-plugin-babel": "^4.0.3",
55+
"rollup-plugin-img": "^1.1.0",
5556
"webpack": "^4.17.2",
5657
"webpack-cli": "^3.1.0",
5758
"webpack-dev-server": "^3.1.7"

rollup.config.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
import babel from "rollup-plugin-babel";
2+
import image from "rollup-plugin-img";
23
import pkg from "./package.json";
34

45
const external = id => !id.startsWith("/") && !id.startsWith(".");
56
const getBabelOptions = () => ({
67
runtimeHelpers: true,
7-
plugins: ["@babel/transform-runtime"]
8+
plugins: ["@babel/transform-runtime"],
89
});
910

1011
export default {
1112
input: "./src/ImageSlider.jsx",
12-
output: {
13+
output: {
1314
file: pkg.main,
14-
format: "cjs"
15+
format: "cjs",
1516
},
1617
plugins: [
1718
babel(getBabelOptions()),
19+
image({ limit: 1000 }),
1820
],
19-
external
20-
}
21+
external,
22+
};

0 commit comments

Comments
 (0)