@pieced/media-config-webpack-plugin
v1.0.4
Published
Automatically configuration webpack5 media loader
Downloads
2
Readme
Automatically configuration webpack5 media loader
Install
npm i --save-dev @pieced/media-config-webpack-plugin
Webpack Config
const MediaConfigWebpackPlugin = require('@pieced/media-config-webpack-plugin');
module.exports = {
plugins: [new MediaConfigWebpackPlugin()],
};
Options
suffix
type array
default ['webm', 'mp4', 'ogv', 'mp3', 'aac', 'ogg', 'wav']
parser
type object
- webpack.rule.parser
- default
const defaultParser = {
dataUrlCondition: {
maxSize: webpack.mode === 'development' ? undefined : 1000,
},
}
generator
type object
- webpack.rule.generator
- default
const defaultGenerator = {
filename: webpack.mode === 'development' ? '[path][name][ext]' : 'static/media/[contenthash:10][ext]',
}