logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: 89c0030d053aab1215fd7bcf8ac64251943660e5
parent: 733ef77ec6cb54d4bb12ef4ed559bf2f4e7480ad
Author: Morgan Bazalgette <the@howl.moe>
Date:   Sat, 31 Mar 2018 17:55:08 +0200

remove gzip

Diffstat:

Abuild.sh7+++++++
Mconfig/webpack/production.js21++-------------------
2 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/build.sh b/build.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Assuming pleroma sits in the upper directory under the dir "pleroma" +rm -rf public/packs public/assets +npm run build +cp public/assets/sw.js ../pleroma/priv/static/sw.js +rm -rf ../pleroma/priv/static/packs +cp -r public/packs ../pleroma/priv/static/packs diff --git a/config/webpack/production.js b/config/webpack/production.js @@ -2,27 +2,16 @@ const webpack = require('webpack'); const merge = require('webpack-merge'); -const CompressionPlugin = require('compression-webpack-plugin'); const sharedConfig = require('./shared.js'); const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; const OfflinePlugin = require('offline-plugin'); const { publicPath } = require('./configuration.js'); const path = require('path'); -let compressionAlgorithm; -try { - const zopfli = require('node-zopfli'); - compressionAlgorithm = (content, options, fn) => { - zopfli.gzip(content, options, fn); - }; -} catch (error) { - compressionAlgorithm = 'gzip'; -} - module.exports = merge(sharedConfig, { output: { - filename: '[name]-[chunkhash].js', - chunkFilename: '[name]-[chunkhash].js', + filename: '[name].js', + chunkFilename: '[name].js', }, devtool: 'source-map', // separate sourcemap file, suitable for production @@ -41,11 +30,6 @@ module.exports = merge(sharedConfig, { comments: false, }, }), - new CompressionPlugin({ - asset: '[path].gz[query]', - algorithm: compressionAlgorithm, - test: /\.(js|css|html|json|ico|svg|eot|otf|ttf)$/, - }), new BundleAnalyzerPlugin({ // generates report.html and stats.json analyzerMode: 'static', generateStatsFile: true, @@ -79,7 +63,6 @@ module.exports = merge(sharedConfig, { '/emoji/sheet.png', // used in emoji-mart ], excludes: [ - '**/*.gz', '**/*.map', 'stats.json', 'report.html',