Verified Commit 5df55650 authored by Morgan Bazalgette's avatar Morgan Bazalgette Committed by Haelwenn
Browse files

remove gzip

parent 803e592b
#!/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
......@@ -2,7 +2,6 @@
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');
......@@ -10,16 +9,6 @@ const { publicPath } = require('./configuration.js');
const path = require('path');
const { URL } = require('whatwg-url');
let compressionAlgorithm;
try {
const zopfli = require('node-zopfli');
compressionAlgorithm = (content, options, fn) => {
zopfli.gzip(content, options, fn);
};
} catch (error) {
compressionAlgorithm = 'gzip';
}
let attachmentHost;
if (process.env.S3_ENABLED === 'true') {
......@@ -37,8 +26,8 @@ if (process.env.S3_ENABLED === 'true') {
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
......@@ -57,11 +46,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 OfflinePlugin({
publicPath: publicPath, // sw.js must be served from the root to avoid scope issues
caches: {
......@@ -85,7 +69,6 @@ module.exports = merge(sharedConfig, {
'/emoji/sheet.png', // used in emoji-mart
],
excludes: [
'**/*.gz',
'**/*.map',
'stats.json',
'report.html',
......
......@@ -73,7 +73,7 @@ module.exports = {
}
),
new ExtractTextPlugin({
filename: '[name].css'
filename: '[name].css',
allChunks: true,
}),
new ManifestPlugin({
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment