Refactor module (loader) rules
- Removed unnecessary url-loader targeting .woff files - Replaced file-loader with url-loader (file is fallback for url) - PostCSS plugins are all loaded manually vs postcss.config.js
This commit is contained in:
@@ -1,23 +1,12 @@
|
||||
'use strict'; // eslint-disable-line
|
||||
|
||||
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
||||
const { default: ImageminPlugin } = require('imagemin-webpack-plugin');
|
||||
const imageminMozjpeg = require('imagemin-mozjpeg');
|
||||
const cssnano = require('cssnano');
|
||||
|
||||
const config = require('./config');
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
new OptimizeCssAssetsPlugin({
|
||||
cssProcessor: cssnano,
|
||||
cssProcessorOptions: {
|
||||
discardComments: { removeAll: true },
|
||||
autoprefixer: {},
|
||||
safe: true,
|
||||
},
|
||||
canPrint: true,
|
||||
}),
|
||||
new ImageminPlugin({
|
||||
optipng: { optimizationLevel: 7 },
|
||||
gifsicle: { optimizationLevel: 3 },
|
||||
|
||||
Reference in New Issue
Block a user