Skip to content

Commit 9e81d1c

Browse files
gafemoyanogaearon
authored andcommitted
Added support for webp images in #442 (#458)
1 parent 10bce5a commit 9e81d1c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Diff for: config/eslint.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module.exports = {
4444
settings: {
4545
'import/ignore': [
4646
'node_modules',
47-
'\\.(json|css|jpg|png|gif|eot|otf|svg|ttf|woff|woff2|mp4|webm)$',
47+
'\\.(json|css|jpg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm)$',
4848
],
4949
'import/extensions': ['.js'],
5050
'import/resolver': {

Diff for: config/webpack.config.dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ module.exports = {
126126
// When you `import` an asset, you get its (virtual) filename.
127127
// In production, they would get copied to the `build` folder.
128128
{
129-
test: /\.(jpg|png|gif|eot|otf|svg|ttf|woff|woff2)(\?.*)?$/,
129+
test: /\.(jpg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)(\?.*)?$/,
130130
include: [paths.appSrc, paths.appNodeModules],
131131
loader: 'file',
132132
query: {

Diff for: config/webpack.config.prod.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,17 @@ module.exports = {
126126
loader: ExtractTextPlugin.extract('style', 'css?-autoprefixer!postcss')
127127
// Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
128128
},
129+
// JSON is not enabled by default in Webpack but both Node and Browserify
130+
// allow it implicitly so we also enable it.
129131
{
130-
// JSON is not enabled by default in Webpack but both Node and Browserify
131-
// allow it implicitly so we also enable it.
132132
test: /\.json$/,
133133
include: [paths.appSrc, paths.appNodeModules],
134134
loader: 'json'
135135
},
136+
// "file" loader makes sure those assets end up in the `build` folder.
137+
// When you `import` an asset, you get its filename.
136138
{
137-
// "file" loader makes sure those assets end up in the `build` folder.
138-
// When you `import` an asset, you get its filename.
139-
test: /\.(jpg|png|gif|eot|otf|svg|ttf|woff|woff2)(\?.*)?$/,
139+
test: /\.(jpg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)(\?.*)?$/,
140140
include: [paths.appSrc, paths.appNodeModules],
141141
loader: 'file',
142142
query: {

0 commit comments

Comments
 (0)