placeholdit-loader
v0.0.5
Published
Placehold.it loader for webpack
Downloads
6
Maintainers
Readme
Placehold.it loader for webpack
Installation
npm install --save-dev placeholdit-loader
Basic usage
// ./webpack.config.js
module.exports = {
...
module: {
loaders: [
{
test: /\.(jpe?g|png|gif)$/i,
loaders: [
'file-loader?name=[name]-[hash:6].[ext]',
'placeholdit-loader?bypassOnDebug=false'
]
}
]
}
}
Or
// ./example.js
var fileAsBase64Src = require("base64-image!placeholdit!./file.png");
document.write('<img src="' + fileAsBase64Src + '" />');
var fileUrl = require("file!placeholdit!./file-2.gif");
document.write('<img src="' + fileUrl + '" />');
License
MIT (http://www.opensource.org/licenses/mit-license.php)