Skip to content

Instantly share code, notes, and snippets.

@siakaramalegos
Last active February 2, 2018 16:27
Show Gist options
  • Save siakaramalegos/e83cf5b53d21ad535182911fa79e90a0 to your computer and use it in GitHub Desktop.
Save siakaramalegos/e83cf5b53d21ad535182911fa79e90a0 to your computer and use it in GitHub Desktop.
webpack.config.js favicon file loading snippet
// webpack.config.js favicon file loading snippet
const nodeModulesPath = path.resolve(__dirname, 'node_modules');
const faviconsPath = path.resolve(__dirname, 'app/favicons/');
// ...
const commonConfig = merge([{
// ...
module: {
rules: [
// Favicons - just pass through to root using same file name
{
include: [faviconsPath],
use: [
{
loader: 'file-loader',
options: { name: '[name].[ext]' }
},
],
},
// Images other than favicons
{
test: /\.(png|svg|jpg|gif)$/,
exclude: [nodeModulesPath, faviconsPath],
use: [ // ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment