Skip to content

Commit dcc1d0b

Browse files
author
Adam Butterworth
authored
fix: update image config and add jpg to smoke test (#67)
1 parent 76c183f commit dcc1d0b

File tree

6 files changed

+23
-6
lines changed

6 files changed

+23
-6
lines changed

config/webpack.dev-stage.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,15 @@ module.exports = Merge.smart(commonConfig, {
102102
{
103103
loader: 'image-webpack-loader',
104104
options: {
105-
optimizationlevel: 7,
106105
mozjpeg: {
107106
progressive: true,
107+
quality: 65,
108108
},
109109
gifsicle: {
110110
interlaced: false,
111111
},
112112
pngquant: {
113-
quality: '65-90',
113+
quality: [0.65, 0.90],
114114
speed: 4,
115115
},
116116
},

config/webpack.dev.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,15 @@ module.exports = Merge.smart(commonConfig, {
102102
{
103103
loader: 'image-webpack-loader',
104104
options: {
105-
optimizationlevel: 7,
106105
mozjpeg: {
107106
progressive: true,
107+
quality: 65,
108108
},
109109
gifsicle: {
110110
interlaced: false,
111111
},
112112
pngquant: {
113-
quality: '65-90',
113+
quality: [0.65, 0.90],
114114
speed: 4,
115115
},
116116
},

config/webpack.prod.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ module.exports = Merge.smart(commonConfig, {
111111
{
112112
loader: 'image-webpack-loader',
113113
options: {
114-
optimizationlevel: 7,
115114
mozjpeg: {
116115
progressive: true,
116+
quality: 65,
117117
},
118118
gifsicle: {
119119
interlaced: false,
120120
},
121121
pngquant: {
122-
quality: '65-90',
122+
quality: [0.65, 0.90],
123123
speed: 4,
124124
},
125125
},

example/src/App.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import appleUrl, { ReactComponent as Apple } from './apple.svg';
33
import './style.scss';
4+
import appleImg from './apple.jpg';
45

56
export default function App() {
67
const newEnglandApples = ['macintosh', 'granny smith'];
@@ -14,6 +15,9 @@ export default function App() {
1415
<Apple style={{ width: '10rem' }} />
1516
<img src={appleUrl} alt="apple" style={{ width: '10rem' }} />
1617
<img src={appleUrl} alt="apple" style={{ width: '10rem' }} />
18+
<br />
19+
<img src={appleImg} alt="apple" style={{ width: '10rem' }} />
20+
<p>Photo by Louis Hansel @shotsoflouis on Unsplash</p>
1721
</div>
1822
);
1923
}

example/src/__snapshots__/App.test.jsx.snap

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,18 @@ exports[`Basic test should render 1`] = `
4444
}
4545
}
4646
/>
47+
<br />
48+
<img
49+
alt="apple"
50+
src="test-file-stub"
51+
style={
52+
Object {
53+
"width": "10rem",
54+
}
55+
}
56+
/>
57+
<p>
58+
Photo by Louis Hansel @shotsoflouis on Unsplash
59+
</p>
4760
</div>
4861
`;

example/src/apple.jpg

2.48 MB
Loading

0 commit comments

Comments
 (0)