@reactway/webpack-builder-plugin-images
v2.0.4
Published
A plugin made for webpack-builder.
Downloads
47
Readme
@reactway/webpack-builder-plugin-images
A plugin made for webpack-builder.
Getting started
$ npm i @reactway/webpack-builder-plugin-images
Add plugin into webpack config by using use()
builder method.
const webpackBuilder = require("@reactway/webpack-builder");
const images = require("@reactway/webpack-builder-plugin-images");
module.exports = new webpackBuilder.Builder(__dirname, {
entry: "./src/app.js",
output: {
path: "./dist",
filename: "[name].bundle.js"
}
})
.use(images)
.toConfig();
Passing options
Options you can pass:
interface ImageLoaderOptions {
limit: string | number;
sourceMap: boolean;
optimizeInDev: boolean;
optimization: ImagesOptimization;
outputFolder: string;
}
More details about @reactway/image-loader
options you can read @reactway/image-loader options.
const webpackBuilder = require("@reactway/webpack-builder");
const images = require("@reactway/webpack-builder-plugin-images");
module.exports = new webpackBuilder.Builder(__dirname, {
entry: "./src/app.js",
output: {
path: "./dist",
filename: "[name].bundle.js"
}
})
.use(images, {
limit:1000
...
})
.toConfig();
Documentation
WIP
License
Released under the MIT license.