Skip to content

Instantly share code, notes, and snippets.

@b-tiwari
Created May 20, 2017 20:48
Show Gist options
  • Save b-tiwari/600f2c80b8b76bde814451ec96d504cd to your computer and use it in GitHub Desktop.
Save b-tiwari/600f2c80b8b76bde814451ec96d504cd to your computer and use it in GitHub Desktop.
Webpack2 Beginner's guide - add url-loader
....
....
module:{
rules:[
{
test:/\.(s*)css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader','sass-loader']
})
},
{
test: /\.(png|jp(e*)g|svg)$/,
use: [{
loader: 'url-loader',
options: {
limit: 8000, // Convert images < 8kb to base64 strings
name: 'images/[hash]-[name].[ext]'
}
}]
}
]
},
....
....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment