png-alpha-loader
v1.0.1
Published
PNG alpha loader for webpack
Downloads
4
Readme
Install
npm install --save-dev png-alpha-loader
Options
alphaOnly: Whether to return the image alpha, width, and size or just an array of alpha 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-alpha-loader',
options: {
alphaOnly: false
}
}
]
}
}
In your application
var mask = require('./image.mask.png');
CLI
webpack --module-bind 'mask.png=png-alpha-loader'
In your application
var mask = require('./image.mask.png');
Inline
In your application
var mask = require('raw-loader!./image.mask.png')