Skip to content

Commit 3197e69

Browse files
committed
Fix rollup external
1 parent a94384a commit 3197e69

File tree

4 files changed

+46
-54
lines changed

4 files changed

+46
-54
lines changed

examples/image-carousel/App.js

+10-14
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,11 @@ const App = () => {
108108
<HotelRow onMouseLeave={handleHover} onMouseEnter={handleHover}>
109109
<CarouselWapeer>
110110
<Carousel hideArrow={!isHover} showDots>
111-
{images.map((img, i) => {
112-
return (
113-
<Carousel.Item key={i}>
114-
<img src={img} width="100%" height="200px" />
115-
</Carousel.Item>
116-
)
117-
})}
111+
{images.map((img, i) => (
112+
<Carousel.Item key={i}>
113+
<img src={img} width="100%" height="200px" />
114+
</Carousel.Item>
115+
))}
118116
</Carousel>
119117
</CarouselWapeer>
120118
<div>
@@ -130,13 +128,11 @@ const App = () => {
130128
</div>
131129
</HotelRow>
132130
<Code>{`<Carousel hideArrow={!isHover} showDots>
133-
{images.map((img, i) => {
134-
return (
135-
<Carousel.Item key={i}>
136-
<img src={img} width="100%" height="200px" />
137-
</Carousel.Item>
138-
)
139-
})}
131+
{images.map((img, i) => (
132+
<Carousel.Item key={i}>
133+
<img src={img} width="100%" height="200px" />
134+
</Carousel.Item>
135+
))}
140136
</Carousel>`}</Code>
141137
<Reference>
142138
<h2 align="center">

examples/news-carousel/App.js

+27-32
Original file line numberDiff line numberDiff line change
@@ -88,39 +88,34 @@ const App = () => {
8888
</h2>
8989
<Notice>Notice: You should try this demo on mobile viewport size</Notice>
9090
<Carousel>
91-
{newsList.map(({ imageSrc, title, comment }, i) => {
92-
return (
93-
<Carousel.Item key={i}>
94-
<Item img={imageSrc}>
95-
<Index>
96-
{i + 1}/{newsList.length}
97-
</Index>
98-
<Detail>
99-
<Title>{title}</Title>
100-
{!!comment && <Comment>{comment.count} comments</Comment>}
101-
</Detail>
102-
</Item>
103-
</Carousel.Item>
104-
)
105-
})}
91+
{newsList.map(({ imageSrc, title, comment }, i) => (
92+
<Carousel.Item key={i}>
93+
<Item img={imageSrc}>
94+
<Index>
95+
{i + 1}/{newsList.length}
96+
</Index>
97+
<Detail>
98+
<Title>{title}</Title>
99+
{!!comment && <Comment>{comment.count} comments</Comment>}
100+
</Detail>
101+
</Item>
102+
</Carousel.Item>
103+
))}
106104
</Carousel>
107-
<Code>{`
108-
<Carousel>
109-
{newsList.map(({ imageSrc, title, comment }, i) => {
110-
return (
111-
<Carousel.Item key={i}>
112-
<Item img={imageSrc}>
113-
<Index>
114-
{i + 1}/{newsList.length}
115-
</Index>
116-
<Detail>
117-
<Title>{title}</Title>
118-
{!!comment && <Comment>{comment.count} comments</Comment>}
119-
</Detail>
120-
</Item>
121-
</Carousel.Item>
122-
)
123-
})}
105+
<Code>{`<Carousel>
106+
{newsList.map(({ imageSrc, title, comment }, i) => (
107+
<Carousel.Item key={i}>
108+
<Item img={imageSrc}>
109+
<Index>
110+
{i + 1}/{newsList.length}
111+
</Index>
112+
<Detail>
113+
<Title>{title}</Title>
114+
{!!comment && <Comment>{comment.count} comments</Comment>}
115+
</Detail>
116+
</Item>
117+
</Carousel.Item>
118+
))}
124119
</Carousel>`}</Code>
125120
<Reference>
126121
<h2 align="center">

examples/simple-sample/App.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,11 @@ const App = () => {
7676
</div>
7777
<hr />
7878
<Carousel cols={cols} rows={rows} gap={gap}>
79-
{[...Array(cols * rows * pages)].map((_, i) => {
80-
return (
81-
<Carousel.Item key={i}>
82-
<Item img={randomImageUrl + i} />
83-
</Carousel.Item>
84-
)
85-
})}
79+
{[...Array(cols * rows * pages)].map((_, i) => (
80+
<Carousel.Item key={i}>
81+
<Item img={randomImageUrl + i} />
82+
</Carousel.Item>
83+
))}
8684
</Carousel>
8785
Photo by{' '}
8886
<a

rollup.config.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ export default [
1313
file: pkg.main,
1414
format: 'cjs'
1515
},
16-
external: [...Object.keys(pkg.dependencies)]
16+
external: [
17+
...Object.keys(pkg.dependencies),
18+
...Object.keys(pkg.peerDependencies)
19+
]
1720
}
1821
]

0 commit comments

Comments
 (0)