npm install --save-dev png-mask-loader
grayOnly: Whether to return the image gray, width, and size or just an array of gray values.
Use the loader either via your webpack config, CLI or inline.
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');
webpack --module-bind 'mask.png=png-mask-loader'
In your application
var mask = require('./image.mask.png');
In your application
var mask = require('raw-loader!./image.mask.png')