Going to attempt allowing SHARP to do our img compression.
This commit is contained in:
@ -55,6 +55,7 @@
|
|||||||
"responsive-loader": "^1.1.0",
|
"responsive-loader": "^1.1.0",
|
||||||
"sanitize-html": "^1.18.2",
|
"sanitize-html": "^1.18.2",
|
||||||
"sass-loader": "^7.0.3",
|
"sass-loader": "^7.0.3",
|
||||||
|
"sharp": "^0.20.5",
|
||||||
"style-loader": "^0.21.0",
|
"style-loader": "^0.21.0",
|
||||||
"uglifyjs-webpack-plugin": "^1.2.7",
|
"uglifyjs-webpack-plugin": "^1.2.7",
|
||||||
"url-loader": "^1.0.1",
|
"url-loader": "^1.0.1",
|
||||||
|
@ -29,7 +29,8 @@ const
|
|||||||
CompressionPlugin = require("compression-webpack-plugin"),
|
CompressionPlugin = require("compression-webpack-plugin"),
|
||||||
UglifyJsPlugin = require('uglifyjs-webpack-plugin'),
|
UglifyJsPlugin = require('uglifyjs-webpack-plugin'),
|
||||||
MiniCssExtractPlugin = require("mini-css-extract-plugin"),
|
MiniCssExtractPlugin = require("mini-css-extract-plugin"),
|
||||||
OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
|
OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"),
|
||||||
|
SharpLoader = require('responsive-loader/sharp')
|
||||||
;
|
;
|
||||||
|
|
||||||
//Constants
|
//Constants
|
||||||
@ -94,6 +95,7 @@ module.exports = function(server, app) {
|
|||||||
use: [{
|
use: [{
|
||||||
loader: "responsive-loader",
|
loader: "responsive-loader",
|
||||||
options: {
|
options: {
|
||||||
|
adapter: SharpLoader,
|
||||||
sizes: [250, 500, 1000, 1500, 2000, 2500],
|
sizes: [250, 500, 1000, 1500, 2000, 2500],
|
||||||
name: "[path][name]_[width]x.[ext]",
|
name: "[path][name]_[width]x.[ext]",
|
||||||
context: 'public'
|
context: 'public'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
const
|
const
|
||||||
webpack = require('webpack'),
|
webpack = require('webpack'),
|
||||||
HtmlWebpackPlugin = require('html-webpack-plugin')
|
HtmlWebpackPlugin = require('html-webpack-plugin'),
|
||||||
|
SharpLoader = require('responsive-loader/sharp')
|
||||||
;
|
;
|
||||||
|
|
||||||
const HTMLWebpackPluginConfig = new HtmlWebpackPlugin({
|
const HTMLWebpackPluginConfig = new HtmlWebpackPlugin({
|
||||||
@ -58,6 +59,7 @@ module.exports = {
|
|||||||
use: [{
|
use: [{
|
||||||
loader: "responsive-loader",
|
loader: "responsive-loader",
|
||||||
options: {
|
options: {
|
||||||
|
adapter: SharpLoader,
|
||||||
sizes: [250, 500, 1000, 1500, 2000, 2500],
|
sizes: [250, 500, 1000, 1500, 2000, 2500],
|
||||||
name: "[path][name]_[width]x.[ext]",
|
name: "[path][name]_[width]x.[ext]",
|
||||||
context: 'public'
|
context: 'public'
|
||||||
|
Reference in New Issue
Block a user