png-mask-loader
v1.0.0
Published
PNG mask loader for webpack
Readme
Install
npm install --save-dev png-mask-loaderOptions
grayOnly: Whether to return the image gray, width, and size or just an array of gray values.
Usage
Use the loader either via your webpack config, CLI or inline.
Via webpack config (recommended)
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.mask\.png$/,
use: 'png-mask-loader',
options: {
grayOnly: false
}
}
]
}
}In your application
var mask = require('./image.mask.png');CLI
webpack --module-bind 'mask.png=png-mask-loader'In your application
var mask = require('./image.mask.png');Inline
In your application
var mask = require('raw-loader!./image.mask.png')