Created
July 5, 2016 21:22
-
-
Save ivanoats/f8185cd16f7ef9fffe14a3b539bc0ab6 to your computer and use it in GitHub Desktop.
gatsby config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function modifyWebpackConfig (config) { | |
// arrow-body-style rule doesn't recognize that the spread operator needs | |
// to be in an object literal | |
// eslint-disable-next-line arrow-body-style | |
config.loader('jpg', (cfg) => { | |
return { | |
...cfg, | |
test: /\.jpe?g$/i, | |
loader: 'file-loader?name=images/[name].[ext]', | |
} | |
}) | |
// eslint-disable-next-line arrow-body-style | |
config.loader('png', (cfg) => { | |
return { | |
...cfg, | |
test: /\.png$/i, | |
loader: 'file-loader?name=images/[name].png', | |
} | |
}) | |
return config | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment