Skip to content

Commit c54841f

Browse files
committed
feature(): add gif image as example
1 parent 58239a0 commit c54841f

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ npm install --save react-filetree
1111

1212
## Usage
1313

14+
![Example]
15+
(assets/example.gif)
16+
1417
### data.js
1518
```
1619
const action = (event) => {

assets/example.gif

235 KB
Loading

example/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { FileTree } from '../src/FileTree';
66

77
// Sample Data
88
const action = (event) => {
9-
console.log('action', event)
9+
const file = event.name;
10+
alert(`action: ${file}`);
1011
}
1112

1213
const sampleData = [

webpack.config.babel.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@ const options = {
2020
}, {
2121
test: /\.(jpg|png|gif)$/,
2222
loader: 'file-loader',
23+
exclude: '/assets/example.gif',
2324
}, {
2425
test: /\.(jpg|png|gif)$/,
2526
loader: 'image-webpack-loader',
2627
query: {
2728
optipng: {
2829
optimizationLevel: 7,
2930
},
30-
}
31+
},
32+
exclude: '/assets/example.gif',
3133
},
3234
]
3335
},

webpack.prod.babel.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ const options = {
2121
}, {
2222
test: /\.(jpg|png|gif)$/,
2323
loader: 'file-loader',
24+
exclude: '/assets/example.gif',
2425
}, {
2526
test: /\.(jpg|png|gif)$/,
2627
loader: 'image-webpack-loader',
2728
query: {
2829
optipng: {
2930
optimizationLevel: 7,
3031
},
31-
}
32+
},
33+
exclude: '/assets/example.gif',
3234
},
3335
]
3436
},

0 commit comments

Comments
 (0)