1.0.5 • Published 1 year ago

@pieced/image-config-webpack-plugin v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Automatically configuration webpack5 image loader

Install

npm i --save-dev @pieced/image-config-webpack-plugin

Webpack Config

const ImageConfigWebpackPlugin = require('@pieced/image-config-webpack-plugin');
module.exports = {
  plugins: [new ImageConfigWebpackPlugin()],
};

Options

suffix

  • type array
  • default ['png', 'jpg', 'jpeg', 'gif', 'svg', 'webp', 'avif']

parser

const defaultParser = {
  dataUrlCondition: {
    maxSize: webpack.mode === 'development' ? undefined : 1000,
  },
}

generator

const defaultGenerator = {
  filename: webpack.mode === 'development' ? '[path][name][ext]' : 'static/images/[contenthash:10][ext]',
}
1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago